Skip to content

Day.js compatibility matrix

Reviewed against Day.js 1.11.21.

This is a scoped migration guide, not a claim that Day.js and atemporal are interchangeable. Atemporal's principal representation is Temporal.ZonedDateTime; use the linked guidance when a row identifies a semantic difference.

Categories

CategoryMeaning
CompatibleThe call and semantic result are equivalent.
Equivalent with semantic differencesMigration is mechanical, but temporal zone, parsing, unit, indexing, or returned type differs.
Plugin requiredThe capability is available after installing and extending the stated plugin.
Not supportedNo publicly guaranteed equivalent exists.
Different recommended approachAtemporal handles the use case, but imitating Day.js would be conceptually incorrect.

Reviewed API areas

AreaDay.js 1.11.21AtemporalCategoryMigration note
Constructiondayjs(input)atemporal(input)Equivalent with semantic differencesBoth construct a date-time wrapper, but atemporal uses Temporal.ZonedDateTime; review construction and representation.
Unix secondsdayjs.unix(seconds)atemporal.unix(seconds)Equivalent with semantic differencesBoth accept Unix seconds; atemporal returns its Temporal-backed wrapper. See construction and representation.
Immutable add / subtractdate.add() / date.subtract()date.add() / date.subtract()Equivalent with semantic differencesBoth return a new instance; review Temporal-backed calendar and time-zone behavior in adding, subtracting, and comparisons.
Formatting tokensdate.format(tokens)date.format(tokens)Equivalent with semantic differencesCommon tokens are familiar, but advanced tokens and locale data are not a blanket compatibility promise; see formatting and locales.
ComparisonsisBefore, isSame, isAfter, isBetweenisBefore, isSame, isAfter, isBetweenEquivalent with semantic differencesReview unit, range, and zone-sensitive behavior in adding, subtracting, and comparisons.
Time zonesutc and timezone pluginsIANA zones in the core APIDifferent recommended approachDo not translate plugin setup mechanically; see time zones.
Durationdayjs.duration(...) with the Duration pluginatemporal.duration(...) returning Temporal.DurationDifferent recommended approachThe duration value and API are different; see durations.
LocalesDay.js locale configurationIntl-backed locale configurationEquivalent with semantic differencesLocale data and formatting behavior differ; see formatting and locales.
Relative timeRelative Time pluginrelativeTime pluginPlugin requiredInstall and extend atemporal's official plugin; see plugins and relative time.
Arbitrary custom pluginsdayjs.extend(customPlugin)No adapter for Day.js plugin interfacesNot supportedMigrate custom behavior as an independent atemporal extension; see plugins and relative time.
Raw Date interopdayjs(new Date())atemporal(new Date())Equivalent with semantic differencesBoth accept Date input, but atemporal returns a Temporal-backed wrapper; see raw Date interop.

For a migration inventory, record the Day.js version, plugins, custom tokens, time-zone use, locale configuration, and raw Date boundaries before applying these mappings.