PackageTrack
Sign in Get early access

moment_dart

Multi-purpose immutable DateTime subclass. Supports multiple localizations to easily convert DateTime and Duration into human-readable format

5.3.4 14K downloads/mo #2549 most downloaded on pub.dev sadespresso/moment_dart

What this package is like to depend on

Last release 3 months ago

03 May 2026

Release timing varies

gaps range from 8 days to 4 months

Nearly every release is documented

notes for 82 of 82 stable releases

3 versions withdrawn

withdrawn after publishing

5 years old

86 releases · first in 2022

7 releases in the last 12 months

see the full history below

Release timeline

86 releases · Feb 2022 to May 2026
2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 86
  1. 5.3.4 03 May 2026
    Release notes
    • Fixed several DST-related off-by-one bugs in startOf/endOf week helpers and their next/last variants.
    • Fixed Moment.calendar() returning the wrong relative day when moment and reference had different timezones.
    • Fixed Moment.timeZoneFormatted() output for negative offsets (now properly zero-padded, e.g. -05:00).
    • Renamed misspelled Calender* types and calender* constants to Calendar* / calendar*. Old names remain as @Deprecated aliases.
    • Misc typo fixes.
    Open source →
  2. 5.3.3 02 May 2026
    Release notes
    Open source →
  3. 5.3.2 19 Apr 2026
    Release notes
    • Added pl_PL - Polish (Poland) thanks to @PawiX25
    Open source →
  4. 5.3.1 12 Feb 2026
    Release notes
    • Made linter happy
    Open source →
  5. 5.3.0 02 Oct 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 5.2.2...5.3.0

    Open source →
    Release notes
    • Added new locale:
      • ru_RU - Russian (Russia)
    Open source →
  6. 5.3.0+1 03 Oct 2025
    Release notes
    • Added new locale:
      • ru_RU - Russian (Russia)
    Open source →
  7. 5.2.4 07 Sep 2025
    Release notes
    • Fix: TimeRange.format() now respects useRelative=false for custom time ranges.
    Open source →
  8. 5.2.3 30 Apr 2025
    Release notes
    • Arabic (ar_PS) ordinals to return the number. (I don't know any Arabic, ur welcome to submit a PR)
    Open source →
  9. 5.2.2 22 Apr 2025
    Release notes

    What's Changed

    • Arabic localization by @Ultrate in #43
    • Added TimeRange.intersect(other) (You can also turn a.intersect(b) as a & b)
    • Added TimeRange.toCustom() and TimeRange.asCustom

    New Contributors

    Full Changelog: 5.0.1...5.2.2

    Open source →
    Release notes
    • Updated README.md to reflect docs domain change
    Open source →
  10. 5.2.1 19 Apr 2025
    Release notes
    • Added TimeRange.intersect(other) (You can also turn a.intersect(b) as a & b)
    • Added TimeRange.toCustom() and TimeRange.asCustom
    Open source →
  11. 5.2.0 19 Apr 2025
    Release notes

    REDACTED

    Open source →
  12. 5.1.0 12 Apr 2025
    Release notes
    • Added Arabic language, thanks to Ultrate
    Open source →
  13. 5.0.1 01 Apr 2025
    Release notes

    What's Changed

    • Clamped setters - set of functions that clamps the value to prevent DateTime's default overflowing.
    • All time ranges' to property is now inclusive (except local/iso week and CustomTimeRange, cause they were inclusive already)
    • This also means DayTimeRange(...).duration will now return exactly 1 less microsecond.

    I am sorry for this change.

    Full Changelog: 4.1.0...5.0.1

    Open source →
    Release notes
    • [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:

      • HourTimeRange
      • DayTimeRange
      • MonthTimeRange
      • YearTimeRange
    Open source →
  14. 5.0.0 01 Apr 2025 withdrawn
    Release notes

    REDACTED

    Open source →
  15. 4.1.0 28 Mar 2025
    Release notes

    What's Changed

    Full Changelog: 4.0.1...4.1.0

    Open source →
    Release notes
    • Added clamped setters that prevents DateTime's overflowing behaviour
      • DateTime.setClampedSecond
      • DateTime.setClampedMinute
      • DateTime.setClampedHour
      • DateTime.setClampedDay
      • DateTime.setClampedMonth
    Open source →
  16. 4.0.1 17 Feb 2025
    Release notes

    What's Changed

    • [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
    • Added Moment.minValueUtc and Moment.maxValueUtc
    • Fixed Moment.minValue and Moment.maxValue overflowing
    • Updated docs

    Full Changelog: 3.1.0...4.0.1

    Open source →
    Release notes
    • Update docs
    Open source →
  17. 4.0.0 16 Feb 2025
    Release notes
    • [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
    • Added Moment.minValueUtc and Moment.maxValueUtc
    • Fixed Moment.minValue and Moment.maxValue overflowing
    Open source →
  18. 3.3.2 08 Feb 2025
    Release notes
    • Removed DateTime.to as per it's deprecated, use DateTime.rangeTo instead.
    Open source →
  19. 3.3.1 25 Jan 2025
    Release notes

    What's new

    • Fixed MonthTimeRange.format() would return "This month" for different year's same month

    Full Changelog: 3.3.0...3.3.1

    Open source →
    Release notes
    • Fixed MonthTimeRange.format() would return "This month" for different year's same months.
    Open source →
  20. 3.3.0 23 Jan 2025
    Release notes

    What's new

    • Pageable TImeRange's next, last no longer generated invalid value (e.g., month 12, day 32, etc..)

    Full Changelog: 3.2.1...3.3.0

    Open source →
    Release notes
    • Fixed where PageableRange.next and/or PageableRange.last could end up with illegal values such as month=13, day=32, etc...
    Open source →
  21. 3.2.1 16 Jan 2025
    Release notes

    Full Changelog: 3.2.0...3.2.1

    Open source →
    Release notes
    • Make static analyzer happy; +10 pts to Gryffindor
    Open source →
  22. 3.2.0 16 Jan 2025
    Release notes

    What's Changed

    Full Changelog: 2.2.0...3.2.0

    Open source →
    Release notes
    • Added new locale:
      • tr_TR - Turkish (Turkey)
    Open source →
  23. 3.1.0 12 Jan 2025
    Release notes

    What's Changed

    • TimeRange now has a unit property that returns its corresponding
      DurationUnit type if available.

    Full Changelog: 3.0.0...3.1.0

    Open source →
    Release notes
    • TimeRange now has a unit property that returns its corresponding DurationUnit type if available.
    Open source →
  24. 3.0.0 31 Dec 2024
    Release notes

    This release has breaking changes!

    • Changed TimeRange.toString() delimiter to @
    • Fixed CustomTimeRange not being able to be parsed
    • Added .encode() and .encodeShort() methods on TimeRange
    • Added TimeRange.fromStartAndDuration constructor
    Open source →
  25. 2.2.1 22 Dec 2024
    Release notes
    • Added TimeRange readable format.
    • Fixed German (de_DE) full abbreviations were in English
    • Added DateTime.isMidnight helper
    Open source →
  26. 2.2.1+beta.0 21 Jul 2024
    Release notes
    • Added TimeRange readable format.
    • Fixed German (de_DE) full abbreviations were in English
    • Added DateTime.isMidnight helper
    Open source →
  27. 2.2.0 20 Jul 2024
    Release notes
    • Fixed .endOf(DurationUnit.week) was incorrectly returning 7 days ahead #19
    • Renamed DateTime.to to .rangeTo for clarity. Old method will be removed on the next released.
    • Added Moment.maxValue and Moment.minValue. For example, now you can use CustomTimeRange(now, Moment.maxValue) or epoch.to(Moment.maxValue)
    Open source →
  28. 2.1.0 18 Apr 2024
    Release notes
    • Fixed LocalWeekTimeRange and IsoWeekTimeRange's to being 1 microsecond ahead
    • Now you can parse/serialize TimeRange by calling TimeRange.parse() and TimeRange.toString()
    Open source →
  29. 2.0.2 03 Mar 2024
    Release notes
    • Expose PageableRange
    Open source →
  30. 2.0.1 03 Mar 2024
    Release notes
    • TimeRange
      • [BREAKING] Renamed all variable/methods with "prev" to "last"
      • Added HourTimeRange, LocalWeekTimeRange and IsoWeekTimeRange, alongside with the static constructors
      • [BREAKING] TimeRange's to is now exclusive. This means DayTimeRange().duration will equal to Duration(days:1) unless there's a daylight saving going on.
      • Added next/last getters on some TimeRange classes.
    • [BREAKING] Removes deprecated formatter tokens YYYYYY and Y
    • Moment. relative constructors
      • [BREAKING] Renamed all variable/methods with "prev" to "last"
      • Added Moment.startOfThisLocalWeek(), with endOf and next/prev variants
      • Added Moment.startOfThisIsoWeek(), with endOf and next/prev variants
      • Added Moment.startOfThisHour(), with endOf and next/prev variants
    • Added relative finder methods such as .startOfNextDay().
    • Added .startOfIsoWeek() and .endOfIsoWeek()
    • Exposes DateTimeConstructors (no longer need to import)
    Open source →
  31. 2.0.0 03 Mar 2024 withdrawn

    Nothing published for this version

  32. 1.2.0 01 Mar 2024
    Release notes
    • Added getter/method to check if DateTime is in the past or future
      • DateTime.isPast
      • DateTime.isPastAnchored(DateTime anchor)
      • DateTime.isFuture
      • DateTime.isFutureAnchored(DateTime anchor)
    • Added Moment.startOfToday()
      • and similar ones for current month and year,
      • and endOf- variants
    • Added TimeRange. Can be constructed in multiple ways:
      • TimeRange.today() and similar ones for current month and year
      • Create one of YearTimeRange, MonthTimeRange,DayTimeRange or
      • CustomTimeRange for custom from/to values.
    Open source →
  33. 1.1.1 02 Feb 2024
    Release notes
    • es_ES last week prefix has been fixed
    • Added Portuguese localization
    Open source →
  34. 1.1.0 18 Oct 2023
    Release notes
    • .startOf(DurationUnit.week) and endOf now works, fixes #13
    Open source →
  35. 1.0.1 28 Aug 2023
    Release notes
    • Update CHANGELOG.md
    Open source →
  36. 1.0.0 28 Aug 2023
    Release notes

    Features breaking changes

    • Now requires Dart v2.19.4
    • Added {reference} argument to ComplexCalendar methods
      • This fixes incorrect results of localizations that use ComplexCalender (i.e., zh_CN, it_IT)
    • Renamed UnitStringForm to Abbreviation
    • Renamed LocalizationKo to LocalizationKoKr for consistency
    • Removed deprecated methods
    • Removed weekStart 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 guess
    • Added DateTimeConstructors.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 timezone
      • Moment().calendar() now matches timezone with this. Meaning, anchor will be set to UTC timezone if this is in UTC timezone
    • DateTimeConstructors.withTimezone now requires isUtc as a positional argument
    • Added getter Moment().hasExplicitLocalization to check if that instance have any explicit localization
    • Added Japanese localization
    • Bugfixes
      • .startOf* now returns correct timezone DateTime
      • [zh-CN] fixed this week was wrongly displayed as last week in Moment().calendar()
    Open source →
  37. 1.0.0-rc.1 26 Aug 2023 pre-release
    Release notes

    Features breaking changes

    • Added {reference} argument to ComplexCalendar methods
      • This fixes incorrect results of localizations that use ComplexCalender (i.e., zh_CN, it_IT)
    • Renamed LocalizationKo to LocalizationKoKr for consistency
    • Removed deprecated methods
    • Removed weekStart 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 guess
    • Added DateTimeConstructors.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 timezone
      • Moment().calendar() now matches timezone with this. Meaning, anchor will be set to UTC timezone if this is in UTC timezone
    • DateTimeConstructors.withTimezone now requires isUtc as a positional argument
    • Added getter Moment().hasExplicitLocalization to check if that instance have any explicit localization
    • Added Japanese localization
    • Bugfixes
      • .startOf* now returns correct timezone DateTime
      • [zh-CN] fixed this week was wrongly displayed as last week in Moment().calendar()
    Open source →
  38. 0.18.1 19 Jul 2023
    Release notes
    • DateTime.isSameLocalWeekAs() now uses default localization's week start if weekStart is omitted. Closes #11
    Open source →
  39. 0.18.0 19 Jul 2023
    Release notes
    • differenceInDays no longer forces local timezone
    • Added date getter, returns Date with hours, minutes, etc set to 0.
    • Added new constructor: DateTimeConstructors.dateWithTimezone
    Open source →
  40. 0.17.5 14 Jul 2023
    Release notes
    • Calendar now accepts DateTime as reference
    • Documentation work has begun.
    Open source →
  41. 0.17.4 12 Mar 2023
    Release notes
    • Fixed extensions, and operations copying default localization when the instance had no explicit localization
    Open source →
  42. 0.17.2 07 Mar 2023
    Release notes
    Open source →
  43. 0.17.1 28 Feb 2023
    Release notes
    • Fixed #9
    • mn_MN, mn_Mong_MN, mn_Qaaq_MN locales now use HH instead of H in LT, LTS formatters
    • Added 3 extension getter for Moment and DateTime objects.
      • .hour12
      • .isAm
      • .isPm
    Open source →
  44. 0.17.0 18 Feb 2023
    Release notes
    • Fixed Moment.format()
    • Corrected Chinese language code (zn -> zh)
    Open source →
  45. 0.16.0 22 Jan 2023
    Release notes

    This release has breaking changes!

    • Duration().toDurationString() first argument is now named, and optional. When null, uses global localization set using Moment.setGlobalLocalization(MomentLocalization)
    • Now weekStart of DateTime().startOfLocalWeek([int weekStart]) is nullable, and defaults to Moment.defaultLocalization.weekStart
    • Now weekStart of DateTime().endOfLocalWeek([int weekStart]) is nullable, and defaults to Moment.defaultLocalization.weekStart
    Open source →
  46. 0.15.0 14 Jan 2023
    Release notes
    • Now it's possible to set global localization with Moment.setGlobalLocalization(MomentLocalization)
    • Renamed 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
    Open source →
  47. 0.14.0 29 Dec 2022
    Release notes

    This release has breaking changes!

    • [BREAKING] moment.format("YY") now no longer throws exception when year doesn't fall in range (1970, 2030). Instead, it returns full year. e.g., DateTime(1969).format("YY"); // 1969
    • [BREAKING] moment.format("gg") now no longer throws exception when ISO week year doesn't fall in range (1970, 2030). Instead, it returns full year. e.g., DateTime(1969).format("gg"); // 1969
    • [BREAKING] DateTime.format(...) now expect named arguments instead of optional positional arguments
    Open source →
  48. 0.13.0 08 Dec 2022
    Release notes

    This release has breaking changes!

    • [BREAKING] endOf_() and startOf_() now preserves the timezone instead of always returning local DateTime object
    • endOf(DurationUnit.microsecond) and startOf(DurationUnit.microsecond) now returns this.clone() instead of throwing error
    Open source →
  49. 0.12.0 23 Nov 2022
    Release notes

    This release has breaking changes!

    • [BREAKING] isAtSameUnit___As(other) now doesn't take timezones into account. If you want the old behaviour, use isAtSameUnit___As(other, enforceUTC: true)
    • [BREAKING] Renamed MomentLocalizations.deDE() to .de()
    • [BREAKING] Removed Moment().elapsed() for sake of Moment().fromPrecise()
    • [BREAKING] Now startOf_() and endOf_() no longer converts to local timezone. It just "assumes" it is in local timezone.
    • All localizations are now lazy-loaded Singletons
    Open source →
  50. 0.11.0 22 Nov 2022
    Release notes
    • Calendar no longer includes time when the date is too distant (distant that it's formatted with 'l' token)
    • Added localization zn_CN
    • Added DateTime.startOfLocalWeek(int weekStart), Moment.startOfLocalWeek(), endOf counterparts
    Open source →
  51. 0.10.5 11 Nov 2022
    Release notes
    • Fixed am/pm suffixes for mn_Mong_MN and mn_Qaaq_MN
    Open source →
  52. 0.10.4 02 Nov 2022
    Release notes
    • isSameAs_() functions timezone now depend on other argument. If other is UTC, this will be converted to UTC, else this will be adjusted with other.timeZoneOffset
    Open source →
  53. 0.10.3 01 Oct 2022
    Release notes
    • Added .format() and other functions as extension on DateTime objects
    • .format() now takes another optional argument forceLocal, to convert the DateTime before formatting.
    Open source →
  54. 0.10.2 28 Sep 2022
    Release notes
    • Fixed endOfMonth() having extra days
    Open source →
  55. 0.10.1 27 Aug 2022
    Release notes
    • Fixed duration suffix in mn_MN, mn_Mong_MN, mn_Qaaq_MN
    Open source →
  56. 0.10.0 27 Aug 2022
    Release notes
    • Introduced concept of 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.full
    • Introduced Moment.fromPrecise(...), Moment.fromNowPrecise(...), Moment.duration(...) for more precise durations
    • German (de_DE) relative duration now shows correct forms when prefixes/suffixes are omitted
    • Removed deprecated functions
    Open source →
  57. 0.9.0 07 Aug 2022 withdrawn
    Release notes
    • Added demo. Check it out
    • Localization
      • Renamed all localization files to their corresponding localization ID
      • Renamed all localization classes to their corresponding localization ID
      • Added static method MomentLocalizations.byLanguage() and MomentLocalizations.byLocale()
    • Fixed Italian localization data
    Open source →
  58. 0.9.0+1 07 Aug 2022
    Release notes
    • Added en_US in MomentLocalizations.locales
    Open source →
  59. 0.8.2 28 Jul 2022
    Release notes
    • Added static method Moment.tryParse()
    Open source →
  60. 0.8.2+1 07 Aug 2022
    Release notes
    • Updated README.md
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive