npm / date-fns
date-fns
What changed in date-fns 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
1 breaking1 deprecations1 new APIs and options5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initdate-fns 48 changes
Breaking changes 1
CDN source maps were removed from date-fns; users relying on them should switch to @date-fns/cdn.
Deprecations 1
CDN scripts are deprecated and will be removed in the next major release; use @date-fns/cdn instead.
New APIs and options 1
Introduces a package for CDN usage that includes CDN source maps.
Fixes and other changes 5
Corrects the pt locale so its first day of the week is Sunday.
Fixes month parsing for October, November, and December in the zh-CN locale.
Fixes month parsing for October, November, and December in the zh-HK locale.
Fixes month parsing for October, November, and December in the zh-TW locale.
Restores type definitions that were missing in v4.2.0 due to a TypeScript misconfiguration.