Answers for "date fns examples npm"

6

date-fns npm package

npm install date-fns --save
# or with yarn 
yarn add date-fns
Posted by: Guest on September-09-2020
0

date-fns npm

import { compareAsc, format } from 'date-fns'

format(new Date(2014, 1, 11), 'yyyy-MM-dd')
//=> '2014-02-11'

const dates = [
  new Date(1995, 6, 2),
  new Date(1987, 1, 11),
  new Date(1989, 6, 10),
]
dates.sort(compareAsc)
//=> [
//   Wed Feb 11 1987 00:00:00,
//   Mon Jul 10 1989 00:00:00,
//   Sun Jul 02 1995 00:00:00
// ]
Posted by: Guest on March-14-2022

Code answers related to "date fns examples npm"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language