NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #361 most downloaded on npm
Modern JavaScript date utility library
Last release 4 months ago
29 May 2026
Ships unpredictably
gaps range from 2 weeks to 1.7 years
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
209 releases · first in 2014
Fixed dd and ddd formatters in Polish language locale. Kudos to @justrag. See PR: #467
Fixed DST border bug in addMilliseconds, addSeconds, addMinutes, addHours, subMilliseconds, subSeconds, subMinutes and subHours. See issue #465
Fixed DST border bug in addMilliseconds, addSeconds, addMinutes, addHours,
subMilliseconds, subSeconds, subMinutes and subHours.
See issue #465
Minor fix for Indonesian locale. Thanks to @bentinata. See PR: #458
One column per quarter.
Romanian locale (ro) (thanks to Sergiu Munteanu @jsergiu)
Various fixes for Dutch locale. See PR: #416. Thanks to Ruben Stolk @rubenstolk
Added generation of TypeScript locale sub-modules, allowing import of locales in TypeScript.
Macedonian locale (mk) (thanks to Petar Vlahu @vlahupetar)
Various fixes for Japanese locale. See PR: 395. Thanks to Yamagishi Kazutoshi @ykzts
Bulgarian locale (bg) (thanks to Nikolay Stoynov @arvigeus)
Bulgarian locale (bg) (thanks to Nikolay Stoynov @arvigeus)
Czech locale (cs) (thanks to David Rus @davidrus)
Modern Standard Arabic locale (ar) (thanks to Abdallah Hassan @AbdallahAHO)
Auto generate TypeScript and flow typings from documentation on release. Thanks to @mattlewis92. See related PRs: #355, #370
Auto generate TypeScript and flow typings from documentation on release. Thanks to @mattlewis92. See related PRs: #355, #370
Croatian locale (hr) (thanks to Matija Marohnić @silvenon)
Thai locale (th) (thanks to Athiwat Hirunworawongkun @athivvat)
Finnish locale (fi) (thanks to Pyry-Samuli Lahti @Pyppe)
Icelandic locale (is) (thanks to Derek Blank @derekblank)
Fixed isBefore and isAfter documentation mistakes.
isBefore and isAfter documentation mistakes.Filipino locale (fil) (thanks to Ian De La Cruz @RIanDeLaCruz)
Filipino locale (fil) (thanks to Ian De La Cruz @RIanDeLaCruz)
Danish locale (da) (kudos to Anders B. Hansen @Andersbiha)
Fixed documentation for getOverlappingDaysInRanges.
getOverlappingDaysInRanges.areRangesOverlapping and getOverlappingDaysInRanges Thanks to Joanna T @asia-t. See PR: #331
Greek locale (el) (kudos to Theodoros Orfanidis @teoulas)
Greek locale (el) (kudos to Theodoros Orfanidis @teoulas)
Slovak locale (sk) (kudos to Marek Suscak @mareksuscak)
Added yarn support. Thanks to Uladzimir Havenchyk @havenchyk. See PR: #288
Turkish locale (tr) (kudos to Alpcan Aydın @alpcanaydin)
Turkish locale (tr) (kudos to Alpcan Aydın @alpcanaydin)
Korean locale (ko) (thanks to Hong Chulju @angdev)
SS and SSS formats in format are now correctly displayed with leading zeros.
Thanks to Paul Dijou @pauldijou.
See PR: #330Polish locale (pl) (thanks to Mateusz Derks @ertrzyiks)
Polish locale (pl) (thanks to Mateusz Derks @ertrzyiks)
Portuguese locale (pt) (thanks to Dário Freire @dfreire)
Swedish locale (sv) (thanks to Johannes Ulén @ejulen)
French locale (fr) (thanks to Jean Dupouy @izeau)
Performance tests. See PR: #289
Fixed TypeScript and flow typings for isValid.
See PR: #310
Fixed incorrect locale tests that could potentially lead to format bugs.
Kudos to Mateusz Derks @ertrzyiks.
See related PRs: #312,
#320
Minor language fixes in the documentation. Thanks to Vedad Šoše @vedadsose (#314) and Asia @asia-t (#318)
format now returns String('Invalid Date') if the passed date is invalid.
See PR: #323
distanceInWords, distanceInWordsToNow, distanceInWordsStrict and format functions now
check if the passed locale is valid, and fallback to English locale otherwise.
See PR: #321
Internal: use a loop instead of Object.keys in buildFormattingTokensRegExp
to improve compatibility with older browsers.
See PR: #322
Italian locale (it) (thanks to Alberto Restifo @albertorestifo)
Italian locale (it) (thanks to Alberto Restifo @albertorestifo)
For German buildDistanceInWordsLocale, add nominative case translations (for distances without a suffix).
Kudos to Asia @asia-t.
See related PR: #295
Fixed TypeScript imports from individual modules. Thanks to @mattlewis92. See related PR: #287
Indonesian locale (id) (thanks to Rahmat Budiharso @rbudiharso)
Indonesian locale (id) (thanks to Rahmat Budiharso @rbudiharso)
Catalan locale (ca) (thanks to Guillermo Grau @guigrpa)
Fixed broken test for Norwegian Bokmål locale.
Norwegian Bokmål locale (nb) (thanks to Hans-Kristian Koren @Hanse)
Chinese Traditional locale (zh_tw) (thanks to tonypai @tpai).
Chinese Traditional locale (zh_tw) (thanks to tonypai @tpai).
Dutch language locale (nl) (kudos to Jorik Tangelder @jtangelder)
Added distanceInWordsStrict to the list of supported functions in I18n doc.
distanceInWordsStrict to the list of supported functions in I18n doc.Spanish language locale (es) (thanks to Juan Angosto @juanangosto).
Bug in parse when it sometimes parses ISO week-numbering dates incorrectly. See PR: #262
Include TypeScript typings with npm package.
distanceInWordsStrict. Kudos to @STRML. See related PR: #254
distanceInWordsStrict.
Kudos to @STRML.
See related PR: #254
TypeScript typings for all functions. Kudos to @mattlewis92. See related PR: #255
parse now can parse dates that are ISO 8601 centuries (e.g., 19 and +0019).
parse now can parse dates that are ISO 8601 centuries (e.g., 19 and +0019).
var result = parse("19");
//=> Mon Jan 01 1900 00:00:00
In parse, added ability to specify the number of additional digits
for extended year or century format (possible values are 0, 1 or 2; default is 2).
parse("+002016-11-01");
parse("+02016-11-01", { additionalDigits: 1 });
parse("+2016-11-01", { additionalDigits: 0 });
Got index.js imports to work with SystemJS.
Added Japanese and German language locales to the list in I18n doc.
Japanese language locale (ja) (thanks to Thomas Eilmsteiner @DeMuu again!)
Japanese language locale (ja) (thanks to Thomas Eilmsteiner @DeMuu again!)
getISODay
setISODay
German language locale (de) (thanks to Thomas Eilmsteiner @DeMuu).
Chinese Simplified locale (zh_cn) (kudos to Changyu @KingMario Geng).
Incorrectly generated docs for format.
Incorrectly generated docs for format.
Fixed typo in I18n doc.
A change log entry for [1.5.0] is added.
### Added - The initial I18n support
Fixed incorrect behaviour of YYYY and YY for years prior to 1000: now format(new Date('0001-01-01'), 'YYYY-MM-DD') returns 0001-01-01 instead of 1-01-
YYYY and YY for years prior to 1000:
now format(new Date('0001-01-01'), 'YYYY-MM-DD') returns 0001-01-01
instead of 1-01-01.### Added - closestIndexTo
closestIndexToAdded an ability to pass negative numbers to setDay.
setDay.Fixed Flow declarations for some of the functions.
Flow declarations for each function in the ".js.flow" style. Kudos to @JohnyDays. See related PRs:
format now returns the correct result for key E.
format now returns the correct result for key E.
Prevent startOf..., endOf... and lastDayOf... functions
to return dates with an incorrect time when the date is modifying
into another time zone.
parse now parses years from 1 AD to 99 AD correctly.
Fix a bug in getISOWeek appearing because of a changing time zone
(e.g., when the given date is in DST and the start of the ISO year is not).
BREAKING: all functions are moved to the root of the library, so they
are now accessible with require('date-fns/name_of_function') or
import nameOfFunction from 'date-fns/name_of_function'.
// Before v1.0.0
var addMonths = require("date-fns/src/add_months");
// v1.0.0 onward
var addMonths = require("date-fns/add_months");
BREAKING: functions that had the last optional argument weekStartsAt
(i.e. endOfWeek, isSameWeek, lastDayOfWeek, setDay, startOfWeek)
now instead receive the object options with the property options.weekStartsOn
as the last argument.
// Before v1.0.0
var result = endOfWeek(new Date(2014, 8, 2), 1);
// v1.0.0 onward
var result = endOfWeek(new Date(2014, 8, 2), { weekStartsOn: 1 });
BREAKING: remove the function getTimeSinceMidnight that was used inside
the other functions.
BREAKING: differenceInDays now returns the number of full days instead
of calendar days.
BREAKING: eachDay and isWithinRange now throw an exception
when the given range boundaries are invalid.
Faster isLeapYear.
Internal: make the documentation more verbose.
Internal: convert the tests from Chai to power-assert allowing them to run against IE8.
addISOYears
closestTo
differenceInCalendarDays
differenceInCalendarISOWeeks
differenceInCalendarISOYears
differenceInCalendarMonths
differenceInCalendarQuarters
differenceInCalendarWeeks
differenceInCalendarYears
differenceInHours
differenceInISOYears
differenceInMilliseconds
differenceInMinutes
differenceInMonths
differenceInQuarters
differenceInSeconds
differenceInWeeks
differenceInYears
distanceInWords
distanceInWordsToNow
endOfISOWeek
endOfISOYear
endOfToday
endOfTomorrow
endOfYesterday
getDaysInYear
isDate
isFriday
isMonday
isSameISOWeek
isSameISOYear
isSaturday
isSunday
isThisHour
isThisISOWeek
isThisISOYear
isThisMinute
isThisMonth
isThisQuarter
isThisSecond
isThisWeek
isThisYear
isThursday
isTomorrow
isTuesday
isValid
isWednesday
isYesterday
lastDayOfISOWeek
lastDayOfISOYear
startOfISOWeek
startOfToday
startOfTomorrow
startOfYesterday
subISOYears
Add Qo, W, Wo, WW, GG, GGGG, Z, ZZ, X, x keys to format.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →