All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
fromRfc2822andfromRfc7231functions now throw an error consistently on invalid inputs (such as "32 Jan 2025" or "25:00:00"). (a1311d9, c90b22c, 48ea9b7, d5cc735, 23d8f7a)
formatRfc7231function now throws on the date which can't be represented in RFC 7231 format (when ISO year is negative or 10000 or more), instead of returning invalid string. (6cfa5f2)- Fix a bug when a year of a date is not a 4-digit integer in
fromRfc2822,fromRfc7231andtoTemporalFromClockTimefunctions (9a24610) - Fix an unexpected error when a date with a 2-digit year is passed to
fromRfc7231(3d68f92) - Fix an unexpected error when
PlainMonthDaypassed totoDateFromClockTimehas a reference ISO year in the distant past or future (16e50e8) - Fix a bug when a year passed to
toDateFromClockTimeis a 2-digit integer (f916df9) - Fix an incorrect result in
startOf...andendOf...functions (#7)
- Fix ReDoS vulnerability in
fromRfc2822function (63c87ad)
toObjectfunction
epochMicrosecondsfunction
withDayOfWeek,isSameWeekfunctions- Support passing
ZonedDateTimetostartOf*andendOf*functions (4ab5e3c, 6f829a2, 4b2f1ba, 8d48511)
startOfWeekandendOfWeekfunctionsparsefunction
- Latin alphabets (
AtoZandatoz) in the given format are now reserved for use as pattern characters informatWithoutLocale. If you want to treat them as literal, escape them. (39f5f9d)
- Fix wrong type annotation in some functions (eb95c5a)
fromJulianDate,fromModifiedJulianDate,modifiedJulianDatefunctionstoDateFromExactTimefunction
toDateFromClockTimereturnsUTCDateinstead ofUTCDateMiniby default.UTCDateis upward compatible toUTCDateMiniso this change will hardly introduce troubles. (5c7ad45)julianDayfunction is renamed tojulianDatesince the word 'julian day' is ambiguous. (f393c25)areIntervalsOverlapping,clamp,compareAsc,compareDesc,earliest,isAfter,isBefore,isWithinInterval,latestfunctions now rejectPlainYearMonthwith different calendar because it's semantically nonsense in most cases. (197c7c9)formatWithoutLocalesupportsVVtoken (time zone ID) (3a651ce)
- Fix TypeScript error when using from CommonJS (7823d45)
startOfYear,startOfMonth,startOfDay,startOfHour,startOfMinute,startOfSecond,endOfYear,endOfMonth,endOfDay,endOfHour,endOfMinute,endOfSecondfunctionsfromRfc2822,fromRfc7231,formatRfc7231,epochSeconds,julianDayfunctions
- Make
formatWithoutLocalenot accept a temporal objects with non-ISO calendar by default. If you want to do that, please useformatNonIsoDateoption.
- Stop exporting
Temporaltype from main module because it messed up docs. (1126424)
- Export custom types and
Temporalitself in main module. (6765b8d)
- Move API docs to JSR.
- Stop exporting the namespace
durationfrom main module. You can still import functions fromvremel/duration. (ffc4687)
- Update the type definition for Temporal API to latest spec. (373c2ce)
areIntervalsOverlapping,clamp,isWithinIntervalfunctions
- Stop converting calendar automatically in
closestIndexToandclosestTofor consistency with other functions. (dcd1f37)
toTemporalFromClockTime,formatWithoutLocalefunctions
- Change type signatures of functions, using generics instead of overload functions. (be7da06)
toDateFromClockTime,closestTo,closestIndexTofunctions
- Fix a broken type definition.
- Fix a bug that some functions are not exported from the package.
earliest,latest,isAfter,isBefore,compareAsc,compareDescfunctionsisEqual,longest,shortestfunctions invremel/duration