NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #3092 most downloaded on pub.dev
Multi-purpose immutable DateTime subclass. Supports multiple localizations to easily convert DateTime and Duration into human-readable format
Last release 5 months ago
03 May 2026
Release timing varies
gaps range from 8 days to 4 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
3 versions withdrawn
withdrawn after publishing
5 years old
86 releases · first in 2022
Renamed misspelled Calender* types and calender* constants to Calendar* / calendar*. Old names remain as @Deprecated aliases.
startOf/endOf week helpers
and their next/last variants.Moment.calendar() returning the wrong relative day when moment and
reference had different timezones.Moment.timeZoneFormatted() output for negative offsets (now properly
zero-padded, e.g. -05:00).Calender* types and calender* constants to
Calendar* / calendar*. Old names remain as @Deprecated aliases.Polish singular fix by @PawiX25
One column per quarter.
Added pl_PL - Polish (Poland) thanks to @PawiX25
- Made linter happy
- Added new locale: - ru_RU - Russian (Russia)
add ru-RU locale by @muhammadyusuf-kurbonov in #50
Full Changelog: 5.2.2...5.3.0
Fix: TimeRange.format() now respects useRelative=false for custom time ranges.
useRelative=false for custom time ranges.Arabic (ar_PS) ordinals to return the number. (I don't know any Arabic, ur welcome to submit a PR)
Arabic localization by @Ultrate in #43
Full Changelog: 5.0.1...5.2.2
Added TimeRange.intersect(other) (You can also turn a.intersect(b) as a & b)
TimeRange.intersect(other) (You can also turn a.intersect(b) as a & b)TimeRange.toCustom() and TimeRange.asCustom> REDACTED
REDACTED
Added Arabic language, thanks to Ultrate
Clamped setters - set of functions that clamps the value to prevent DateTime's default overflowing.
to property is now inclusive (except local/iso week and CustomTimeRange, cause they were inclusive already)I am sorry for this change.
Full Changelog: 4.1.0...5.0.1
[BREAKING] All time ranges' to is now inclusive, same as
CustomTimeRange and local/iso week ranges. It also means non-custom or
non-week time ranges .duration will now have one less microsecond.
Affected classes are:
> REDACTED
REDACTED
add clamped setters by @sadespresso in #39
DateTime.setClampedSecondDateTime.setClampedMinuteDateTime.setClampedHourDateTime.setClampedDayDateTime.setClampedMonth[BREAKING] TimeRange month translation now includes the year, but year is omitted when useRelative is true and anchor.year is same as the range year
TimeRange month translation now includes the year, but year is omitted when useRelative is true and anchor.year is same as the range yearMoment.minValueUtc and Moment.maxValueUtcMoment.minValue and Moment.maxValue overflowingFull Changelog: 3.1.0...4.0.1
[BREAKING] TimeRange month translation now includes the year
useRelative is true and anchor.year is same
as the range yearMoment.minValueUtc and Moment.maxValueUtcMoment.minValue and Moment.maxValue overflowingRemoved DateTime.to as per it's deprecated, use DateTime.rangeTo instead.
DateTime.to as per it's deprecated, use DateTime.rangeTo instead.Fixed MonthTimeRange.format() would return "This month" for different year's same month
Full Changelog: 3.3.0...3.3.1
Pageable TImeRange's next , last no longer generated invalid value (e.g., month 12, day 32, etc..)
next, last no longer generated invalid value (e.g., month 12, day 32, etc..)Full Changelog: 3.2.1...3.3.0
PageableRange.next and/or PageableRange.last could end up with
illegal values such as month=13, day=32, etc...Full Changelog : 3.2.0...3.2.1
Full Changelog: 3.2.0...3.2.1
Turkish locale #28 by @sadespresso in #30
TimeRange now has a unit property that returns its corresponding DurationUnit type if available.
TimeRange now has a unit property that returns its correspondingFull Changelog: 3.0.0...3.1.0
> This release has breaking changes!
This release has breaking changes!
TimeRange.toString() delimiter to @.encode() and .encodeShort() methods on TimeRangeTimeRange.fromStartAndDuration constructorAdded TimeRange readable format.
TimeRange readable format.DateTime.isMidnight helperAdded TimeRange readable format.
TimeRange readable format.DateTime.isMidnight helperFixed .endOf(DurationUnit.week) was incorrectly returning 7 days ahead #19
.endOf(DurationUnit.week) was incorrectly returning 7 days ahead #19DateTime.to to .rangeTo for clarity. Old method will be removed on the next released.Moment.maxValue and Moment.minValue. For example, now you can use CustomTimeRange(now, Moment.maxValue) or epoch.to(Moment.maxValue)Fixed LocalWeekTimeRange and IsoWeekTimeRange's to being 1 microsecond ahead
LocalWeekTimeRange and IsoWeekTimeRange's to being 1 microsecond aheadTimeRange by calling TimeRange.parse() and TimeRange.toString()- Expose PageableRange
PageableRange[BREAKING] Removes deprecated formatter tokens YYYYYY and Y
HourTimeRange, LocalWeekTimeRange and IsoWeekTimeRange, alongside with the static constructorsto is now exclusive. This means
DayTimeRange().duration will equal to Duration(days:1) unless there's a
daylight saving
going on.YYYYYY and YMoment. relative constructors
Moment.startOfThisLocalWeek(), with endOf and next/prev variantsMoment.startOfThisIsoWeek(), with endOf and next/prev variantsMoment.startOfThisHour(), with endOf and next/prev variants.startOfNextDay()..startOfIsoWeek() and .endOfIsoWeek()DateTimeConstructors (no longer need to import)Nothing published for this version
Added getter/method to check if DateTime is in the past or future
DateTime is in the past or future
DateTime.isPastDateTime.isPastAnchored(DateTime anchor)DateTime.isFutureDateTime.isFutureAnchored(DateTime anchor)Moment.startOfToday()
endOf- variantsTimeRange. Can be constructed in multiple ways:
TimeRange.today() and similar ones for current month and yearYearTimeRange, MonthTimeRange,DayTimeRange orCustomTimeRange for custom from/to values.es_ES last week prefix has been fixed
es_ES last week prefix has been fixed.startOf(DurationUnit.week) and endOf now works, fixes #13
.startOf(DurationUnit.week) and endOf now works, fixes #13- Update CHANGELOG.md
Added {reference} argument to ComplexCalendar methods
Features breaking changes
ComplexCalendar methods
ComplexCalender (i.e., zh_CN, it_IT)UnitStringForm to AbbreviationLocalizationKo to LocalizationKoKr for consistencyweekStart from Moment().calendar() as it's not used. I don't know why I put it there, I don't drink alcohol, maybe I was just tired I guessDateTimeConstructors.nowWithTimezone constructor
Moment().fromNow() and Moment.fromNowPrecise() now matches timezone with this. Meaning, anchor will be set to UTC timezone if this is in UTC timezoneMoment().calendar() now matches timezone with this. Meaning, anchor will be set to UTC timezone if this is in UTC timezoneDateTimeConstructors.withTimezone now requires isUtc as a positional argumentMoment().hasExplicitLocalization to check if that instance have any explicit localization.startOf* now returns correct timezone DateTimeMoment().calendar()Added {reference} argument to ComplexCalendar methods
Features breaking changes
ComplexCalendar methods
ComplexCalender (i.e., zh_CN, it_IT)LocalizationKo to LocalizationKoKr for consistencyweekStart from Moment().calendar() as it's not used. I don't know why I put it there, I don't drink alcohol, maybe I was just tired I guessDateTimeConstructors.nowWithTimezone constructor
Moment().fromNow() and Moment.fromNowPrecise() now matches timezone with this. Meaning, anchor will be set to UTC timezone if this is in UTC timezoneMoment().calendar() now matches timezone with this. Meaning, anchor will be set to UTC timezone if this is in UTC timezoneDateTimeConstructors.withTimezone now requires isUtc as a positional argumentMoment().hasExplicitLocalization to check if that instance have any explicit localization.startOf* now returns correct timezone DateTimeMoment().calendar()DateTime.isSameLocalWeekAs() now uses default localization's week start if weekStart is omitted. Closes #11
DateTime.isSameLocalWeekAs() now uses default localization's week start if weekStart is omitted. Closes #11differenceInDays no longer forces local timezone
differenceInDays no longer forces local timezonedate getter, returns Date with hours, minutes, etc set to 0.DateTimeConstructors.dateWithTimezoneCalendar now accepts DateTime as reference
DateTime as referenceFixed extensions, and operations copying default localization when the instance had no explicit localization
- Fixed #10
mn_MN, mn_Mong_MN, mn_Qaaq_MN locales now use HH instead of H in LT, LTS formatters
HH instead of H in LT, LTS formattersMoment and DateTime objects.
.hour12.isAm.isPmCorrected Chinese language code (zn -> zh)
Moment.format()> This release has breaking changes!
This release has breaking changes!
Duration().toDurationString() first argument is now named, and optional. When null, uses global localization set using Moment.setGlobalLocalization(MomentLocalization)weekStart of DateTime().startOfLocalWeek([int weekStart]) is nullable, and defaults to Moment.defaultLocalization.weekStartweekStart of DateTime().endOfLocalWeek([int weekStart]) is nullable, and defaults to Moment.defaultLocalization.weekStartRenamed Moment.localization to Moment._localization, making it private, and nullable. However, this shouldn't be breaking change as Moment.localizatio…
Moment.setGlobalLocalization(MomentLocalization)Moment.localization to Moment._localization, making it private, and nullable. However, this shouldn't be breaking change as Moment.localization getter is introduced. Getter returns instances' localization, or global localization in case the instance doesn't have set localization> This release has breaking changes!
This release has breaking changes!
DateTime(1969).format("YY"); // 1969DateTime(1969).format("gg"); // 1969DateTime.format(...) now expect named arguments instead of optional positional arguments> This release has breaking changes!
This release has breaking changes!
endOf_() and startOf_() now preserves the timezone instead of always returning local DateTime objectendOf(DurationUnit.microsecond) and startOf(DurationUnit.microsecond) now returns this.clone() instead of throwing error> This release has breaking changes!
This release has breaking changes!
isAtSameUnit___As(other) now doesn't take timezones into account. If you want the old behaviour, use isAtSameUnit___As(other, enforceUTC: true)MomentLocalizations.deDE() to .de()Moment().elapsed() for sake of Moment().fromPrecise()startOf_() and endOf_() no longer converts to local timezone. It just "assumes" it is in local timezone.Calendar no longer includes time when the date is too distant (distant that it's formatted with 'l' token)
zn_CNDateTime.startOfLocalWeek(int weekStart), Moment.startOfLocalWeek(), endOf counterpartsFixed am/pm suffixes for mn_Mong_MN and mn_Qaaq_MN
mn_Mong_MN and mn_Qaaq_MNisSameAs_() functions timezone now depend on other argument. If other is UTC, this will be converted to UTC, else this will be adjusted with other.tim
other argument. If other is UTC, this will be converted to UTC, else this will be adjusted with other.timeZoneOffsetAdded .format() and other functions as extension on DateTime objects
.format() and other functions as extension on DateTime objects.format() now takes another optional argument forceLocal, to convert the DateTime before formatting.Fixed endOfMonth() having extra days
Fixed duration suffix in mn_MN, mn_Mong_MN, mn_Qaaq_MN
mn_MN, mn_Mong_MN, mn_Qaaq_MNIntroduced concept of UnitString, a wrapper class for unit translations. For example, UnitString for minute may look like "19 minutes", "19 min", "19m
UnitString, a wrapper class for unit translations. For example, UnitString for minute may look like "19 minutes", "19 min", "19m" depending on the UnitStringForm (full, mid, short respectively)
Moment.from(...) and Moment.fromNow(...) now takes form argument, which can alter the output. Defaults to UnitStringForm.fullMoment.fromPrecise(...), Moment.fromNowPrecise(...), Moment.duration(...) for more precise durationsAdded en_US in MomentLocalizations.locales
Renamed all localization files to their corresponding localization ID
MomentLocalizations.byLanguage() and MomentLocalizations.byLocale()- Updated README.md
Added static method Moment.tryParse()
Moment.tryParse()Your coding agent can read these notes before it upgrades. Set up the MCP server →