Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const dayjs = require("dayjs") // or import dayjs from 'dayjs'
- console.log("Format date DD-MM-YYYY", dayjs('2019-08-01').format('DD-MM-YYYY'))
- // => Format date DD-MM-YYYY 01-08-2019
- console.log("Format date DD-MMMM-YYYY", dayjs('2019-08-01').format('DD-MMMM-YYYY'))
- // => Format date DD-MMMM-YYYY 01-August-2019
- console.log("Last date in August 2019", dayjs('2019-08-01').endOf('month').toDate())
- // => Last date in August 2019 2019-08-31T16:59:59.999Z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement