dayjs-greet
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

DayJS Greet Plugin

A Day.js plugin to get time-based greeting.

Installation

npm i dayjs-greet

Initialization

import dayjs from 'dayjs'
import greetPlugin from 'dayjs-greet'

// import dayjs locales before you extend dayjs
// import 'dayjs/locale/de';
dayjs.extend(greetPlugin)

Usage

dayjs('2022-03-08 08:00:00').greet() // Good morning
dayjs('2022-03-08 08:00:00').greet(' Your Name!') // Good morning Your Name!
dayjs('2022-03-08 13:00:00').greet() // Good afternoon
dayjs('2022-03-08 13:00:00').greet(' Your Name!') // Good afternoon Your Name!
dayjs('2022-03-08 20:00:00').greet() // Good evening
dayjs('2022-03-08 20:00:00').greet(' Your Name!') // Good evening Your Name!

Contributors

contributers

Package Sidebar

Install

npm i dayjs-greet

Weekly Downloads

49

Version

1.1.2

License

MIT

Unpacked Size

38.7 kB

Total Files

61

Last publish

Collaborators

  • dev-rise