Package Exports
- dayjs-greet
- dayjs-greet/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dayjs-greet) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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!