date-fns
Date helpers
Last updated 10 years ago by kossnocorp .
Repository · Bugs · Original npm · Tarball · package.json
$ npm install date-fns 
SYNC missed versions from official npm registry.

🎉️ NEW: date-fns v3 is out!

date-fns

date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js

👉 Documentation

👉 Blog


It's like Lodash for dates

  • It has 200+ functions for all occasions.
  • Modular: Pick what you need. Works with webpack, Browserify, or Rollup and also supports tree-shaking.
  • Native dates: Uses existing native type. It doesn't extend core objects for safety's sake.
  • Immutable & Pure: Built using pure functions and always returns a new date instance.
  • TypeScript: The library is 100% TypeScript with brand-new handcrafted types.
  • I18n: Dozens of locales. Include only what you need.
  • and many more benefits
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
// ]

The library is available as an npm package. To install the package run:

npm install date-fns --save

Docs

See date-fns.org for more details, API, and other docs.


License

MIT © Sasha Koss

Current Tags

  • 4.1.0                                ...           latest (2 months ago)
  • 4.0.0-beta.1                                ...           next (2 months ago)

204 Versions

  • 4.1.0                                ...           2 months ago
  • 4.0.0                                ...           2 months ago
  • 4.0.0-beta.1                                ...           2 months ago
  • 4.0.0-alpha.1                                ...           2 months ago
  • 3.6.0                                ...           8 months ago
  • 3.5.0                                ...           8 months ago
  • 3.4.0                                ...           8 months ago
  • 3.3.1                                ...           10 months ago
  • 3.3.0                                ...           10 months ago
  • 3.2.0                                ...           10 months ago
  • 3.1.0                                ...           10 months ago
  • 3.0.6                                ...           a year ago
  • 3.0.5                                ...           a year ago
  • 3.0.4                                ...           a year ago
  • 3.0.3                                ...           a year ago
  • 3.0.2                                ...           a year ago
  • 3.0.2-rc.1                                ...           a year ago
  • 3.0.1                                ...           a year ago
  • 3.0.1-rc.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 3.0.0-rc.2                                ...           a year ago
  • 3.0.0-rc.1                                ...           a year ago
  • 3.0.0-beta.1                                ...           a year ago
  • 3.0.0-alpha.2                                ...           a year ago
  • 3.0.0-alpha.1                                ...           a year ago
  • 2.30.0                                ...           2 years ago
  • 2.29.3                                ...           2 years ago
  • 2.29.2                                ...           2 years ago
  • 2.29.1                                ...           2 years ago
  • 2.29.0                                ...           2 years ago
  • 2.28.0                                ...           3 years ago
  • 2.27.0                                ...           3 years ago
  • 2.26.0                                ...           3 years ago
  • 2.25.0                                ...           3 years ago
  • 2.24.0                                ...           3 years ago
  • 2.23.0                                ...           3 years ago
  • 2.22.1                                ...           3 years ago
  • 2.22.0                                ...           3 years ago
  • 2.21.3                                ...           4 years ago
  • 2.21.2                                ...           4 years ago
  • 2.21.1                                ...           4 years ago
  • 2.21.0                                ...           4 years ago
  • 2.20.3                                ...           4 years ago
  • 2.20.2                                ...           4 years ago
  • 2.20.1                                ...           4 years ago
  • 2.20.0                                ...           4 years ago
  • 2.19.0                                ...           4 years ago
  • 2.18.0                                ...           4 years ago
  • 2.17.0                                ...           4 years ago
  • 2.16.1                                ...           4 years ago
  • 2.16.0                                ...           4 years ago
  • 2.15.0                                ...           4 years ago
  • 2.14.0                                ...           4 years ago
  • 2.13.0                                ...           5 years ago
  • 2.12.0                                ...           5 years ago
  • 2.11.1                                ...           5 years ago
  • 2.11.0                                ...           5 years ago
  • 2.10.0                                ...           5 years ago
  • 2.9.0                                ...           5 years ago
  • 2.8.1                                ...           5 years ago
  • 2.8.0                                ...           5 years ago
  • 2.7.0                                ...           5 years ago
  • 2.6.0                                ...           5 years ago
  • 2.5.1                                ...           5 years ago
  • 2.5.0                                ...           5 years ago
  • 2.4.1                                ...           5 years ago
  • 2.4.0                                ...           5 years ago
  • 2.3.0                                ...           5 years ago
  • 2.2.1                                ...           5 years ago
  • 2.1.0                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 2.0.0-beta.5                                ...           5 years ago
  • 2.0.0-beta.4                                ...           5 years ago
  • 2.0.0-beta.3                                ...           5 years ago
  • 2.0.0-beta.2                                ...           5 years ago
  • 2.0.0-beta.1                                ...           5 years ago
  • 2.0.0-alpha.37                                ...           5 years ago
  • 2.0.0-alpha.36                                ...           5 years ago
  • 2.0.0-alpha.35                                ...           5 years ago
  • 2.0.0-alpha.34                                ...           5 years ago
  • 2.0.0-alpha.33                                ...           5 years ago
  • 2.0.0-alpha.32                                ...           5 years ago
  • 2.0.0-alpha.31                                ...           5 years ago
  • 2.0.0-alpha.30                                ...           5 years ago
  • 2.0.0-alpha.29                                ...           5 years ago
  • 2.0.0-alpha.28                                ...           5 years ago
  • 2.0.0-alpha.27                                ...           6 years ago
  • 2.0.0-alpha.26                                ...           6 years ago
  • 1.30.1                                ...           6 years ago
  • 2.0.0-alpha.25                                ...           6 years ago
  • 2.0.0-alpha.24                                ...           6 years ago
  • 2.0.0-alpha.23                                ...           6 years ago
  • 2.0.0-alpha.22                                ...           6 years ago
  • 2.0.0-alpha.21                                ...           6 years ago
  • 2.0.0-alpha.20                                ...           6 years ago
  • 2.0.0-alpha.18                                ...           6 years ago
  • 2.0.0-alpha.16                                ...           6 years ago
  • 2.0.0-alpha.14                                ...           6 years ago
  • 2.0.0-alpha.13                                ...           6 years ago
  • 2.0.0-alpha.11                                ...           6 years ago
  • 2.0.0-alpha.10                                ...           6 years ago
  • 2.0.0-alpha.9                                ...           6 years ago
  • 2.0.0-alpha.8                                ...           7 years ago
  • 1.29.0                                ...           7 years ago
  • 2.0.0-alpha.7                                ...           7 years ago
  • 2.0.0-alpha.6                                ...           7 years ago
  • 2.0.0-alpha.5                                ...           7 years ago
  • 2.0.0-alpha.4                                ...           7 years ago
  • 2.0.0-alpha.3                                ...           7 years ago
  • 2.0.0-alpha.2                                ...           7 years ago
  • 2.0.0-alpha.1                                ...           7 years ago
  • 1.28.5                                ...           7 years ago
  • 1.28.4                                ...           8 years ago
  • 1.28.3                                ...           8 years ago
  • 1.28.2                                ...           8 years ago
  • 1.28.1                                ...           8 years ago
  • 1.28.0                                ...           8 years ago
  • 1.27.2                                ...           8 years ago
  • 1.27.1                                ...           8 years ago
  • 1.27.0                                ...           8 years ago
  • 1.26.0                                ...           8 years ago
  • 1.25.0                                ...           8 years ago
  • 1.24.0                                ...           8 years ago
  • 1.23.0                                ...           8 years ago
  • 1.22.0                                ...           8 years ago
  • 1.21.1                                ...           8 years ago
  • 1.21.0                                ...           8 years ago
  • 1.20.1                                ...           8 years ago
  • 1.20.0                                ...           8 years ago
  • 1.19.0                                ...           8 years ago
  • 1.18.0                                ...           8 years ago
  • 1.17.0                                ...           8 years ago
  • 1.16.0                                ...           8 years ago
  • 1.15.1                                ...           8 years ago
  • 1.15.0                                ...           8 years ago
  • 1.14.1                                ...           8 years ago
  • 1.14.0                                ...           8 years ago
  • 1.13.0                                ...           8 years ago
  • 1.12.1                                ...           8 years ago
  • 1.12.0                                ...           8 years ago
  • 1.11.2                                ...           8 years ago
  • 1.11.1                                ...           8 years ago
  • 1.11.0                                ...           8 years ago
  • 1.10.0                                ...           8 years ago
  • 1.9.0                                ...           8 years ago
  • 1.8.1                                ...           8 years ago
  • 1.8.0                                ...           8 years ago
  • 1.7.0                                ...           8 years ago
  • 1.6.0                                ...           8 years ago
  • 1.5.2                                ...           8 years ago
  • 1.5.1                                ...           8 years ago
  • 1.5.0                                ...           8 years ago
  • 1.4.0                                ...           8 years ago
  • 1.3.0                                ...           8 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.1                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
  • 1.0.0-rc22                                ...           8 years ago
  • 1.0.0-rc21                                ...           9 years ago
  • 1.0.0-rc19                                ...           9 years ago
  • 1.0.0-rc18                                ...           9 years ago
  • 1.0.0-rc17                                ...           9 years ago
  • 1.0.0-rc16                                ...           9 years ago
  • 1.0.0-rc15                                ...           9 years ago
  • 1.0.0-rc14                                ...           9 years ago
  • 1.0.0-rc13                                ...           9 years ago
  • 1.0.0-rc12                                ...           9 years ago
  • 1.0.0-rc11                                ...           9 years ago
  • 1.0.0-rc10                                ...           9 years ago
  • 1.0.0-rc9                                ...           9 years ago
  • 1.0.0-rc8                                ...           9 years ago
  • 1.0.0-rc6                                ...           9 years ago
  • 1.0.0-rc5                                ...           9 years ago
  • 1.0.0-rc4                                ...           9 years ago
  • 1.0.0-rc3                                ...           9 years ago
  • 1.0.0-rc2                                ...           9 years ago
  • 1.0.0-rc1                                ...           9 years ago
  • 1.0.0-alpha4                                ...           9 years ago
  • 1.0.0-alpha3                                ...           9 years ago
  • 1.0.0-alpha2                                ...           9 years ago
  • 1.0.0-alpha1                                ...           9 years ago
  • 0.17.0                                ...           9 years ago
  • 0.16.0                                ...           9 years ago
  • 0.15.0                                ...           9 years ago
  • 0.14.11                                ...           9 years ago
  • 0.14.9                                ...           10 years ago
  • 0.14.8                                ...           10 years ago
  • 0.14.5                                ...           10 years ago
  • 0.13.0                                ...           10 years ago
  • 0.12.1                                ...           10 years ago
  • 0.12.0                                ...           10 years ago
  • 0.11.0                                ...           10 years ago
  • 0.10.0                                ...           10 years ago
  • 0.9.0                                ...           10 years ago
  • 0.8.0                                ...           10 years ago
  • 0.7.0                                ...           10 years ago
  • 0.6.0                                ...           10 years ago
  • 0.5.0                                ...           10 years ago
  • 0.4.0                                ...           10 years ago
  • 0.3.0                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.0                                ...           10 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE