MCPcopy
hub / github.com/date-fns/date-fns

github.com/date-fns/date-fns @v4.4.0 sqlite

repository ↗ · DeepWiki ↗ · release v4.4.0 ↗
1,344 symbols 4,442 edges 1,612 files 3 documented · 0%
README

🔥️ NEW: date-fns v4.0 with first-class time zone support 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

Extension points exported contracts — how you extend this code

ConstructableDate (Interface)
(no doc)
pkgs/core/src/types.ts
ConfigModule (Interface)
(no doc)
pkgs/docs/src/bin.ts
TZChangeInterval (Interface)
(no doc)
pkgs/tz/src/tzScan/index.ts
GenericDateConstructor (Interface)
(no doc)
pkgs/core/src/types.ts
RefType (Interface)
(no doc)
pkgs/docs/src/json.ts
TZChange (Interface)
(no doc)
pkgs/tz/src/tzScan/index.ts
Duration (Interface)
(no doc)
pkgs/core/src/types.ts
Config (Interface)
(no doc)
pkgs/docs/src/types.ts

Core symbols most depended-on inside this repo

tz
called by 544
pkgs/tz/playground.mjs
toISOString
called by 493
pkgs/tz/src/date/index.js
buildLocalizeFn
called by 425
pkgs/core/src/locale/_lib/buildLocalizeFn/index.ts
buildMatchFn
called by 420
pkgs/core/src/locale/_lib/buildMatchFn/index.ts
convertToFP
called by 405
pkgs/core/src/fp/_lib/convertToFP/index.ts
assertType
called by 359
pkgs/core/src/_lib/test/index.ts
parse
called by 307
pkgs/core/src/parse/index.ts
buildFormatLongFn
called by 279
pkgs/core/src/locale/_lib/buildFormatLongFn/index.ts

Shape

Function 869
Interface 267
Method 121
Class 86
Enum 1

Languages

TypeScript100%

Modules by API surface

pkgs/docs/src/types.ts19 symbols
pkgs/core/src/parseISO/index.ts19 symbols
pkgs/docs/src/utils.ts17 symbols
pkgs/core/src/types.ts14 symbols
pkgs/tz/src/date/mini.js13 symbols
pkgs/tz/src/date/index.js13 symbols
pkgs/core/src/locale/types.ts13 symbols
pkgs/core/scripts/release/buildChangelog.ts13 symbols
pkgs/core/src/parse/_lib/Setter.ts11 symbols
pkgs/docs/src/json.ts9 symbols
pkgs/core/src/parse/_lib/utils.ts9 symbols
pkgs/core/src/_lib/format/lightFormatters/index.ts9 symbols

Dependencies from manifests, versioned

@arethetypeswrong/cli0.18.2 · 1×
@babel/cli7.28.0 · 1×
@babel/core7.28.0 · 1×
@babel/plugin-transform-modules-commonjs7.24.1 · 1×
@babel/preset-env7.28.0 · 1×
@babel/preset-typescript7.27.1 · 1×
@babel/runtime7.28.2 · 1×
@date-fns/devworkspace:* · 1×
@date-fns/docsworkspace:* · 1×
@date-fns/tzworkspace:* · 1×
@date-fns/utcworkspace:* · 1×
@deno/docjsr:^0.181.0 · 1×

For agents

$ claude mcp add date-fns \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact