Guest User

Untitled

a guest
Sep 11th, 2019
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const dayjs = require("dayjs") // or import dayjs from 'dayjs'
  2.  
  3. console.log("Format date DD-MM-YYYY", dayjs('2019-08-01').format('DD-MM-YYYY'))
  4. // => Format date DD-MM-YYYY 01-08-2019
  5.  
  6. console.log("Format date DD-MMMM-YYYY", dayjs('2019-08-01').format('DD-MMMM-YYYY'))
  7. // => Format date DD-MMMM-YYYY 01-August-2019
  8.  
  9. console.log("Last date in August 2019", dayjs('2019-08-01').endOf('month').toDate())
  10. // => Last date in August 2019 2019-08-31T16:59:59.999Z
RAW Paste Data