moment_dart 3.3.2  moment_dart: ^3.3.2 copied to clipboard
moment_dart: ^3.3.2 copied to clipboard
Multi-purpose immutable DateTime subclass. Supports multiple localizations to easily convert DateTime and Duration into human-readable format
3.3.2 #
- Removed DateTime.toas per it's deprecated, useDateTime.rangeToinstead.
3.3.1 #
- Fixed MonthTimeRange.format() would return "This month" for different year's same months.
3.3.0 #
- Fixed where PageableRange.nextand/orPageableRange.lastcould end up with illegal values such as month=13, day=32, etc...
3.2.1 #
- Make static analyzer happy; +10 pts to Gryffindor
3.2.0 #
- Added new locale:
- tr_TR - Turkish (Turkey)
 
3.1.0 #
- TimeRangenow has a- unitproperty that returns its corresponding DurationUnit type if available.
3.0.0 #
This release has breaking changes!
- Changed TimeRange.toString()delimiter to@
- Fixed CustomTimeRange not being able to be parsed
- Added .encode()and.encodeShort()methods onTimeRange
- Added TimeRange.fromStartAndDurationconstructor
2.2.1 #
- Added TimeRangereadable format.
- Fixed German (de_DE) full abbreviations were in English
- Added DateTime.isMidnighthelper
2.2.1+beta.0 #
- Added TimeRangereadable format.
- Fixed German (de_DE) full abbreviations were in English
- Added DateTime.isMidnighthelper
2.2.0 #
- Fixed .endOf(DurationUnit.week)was incorrectly returning 7 days ahead #19
- Renamed DateTime.toto.rangeTofor clarity. Old method will be removed on the next released.
- Added Moment.maxValueandMoment.minValue. For example, now you can useCustomTimeRange(now, Moment.maxValue)orepoch.to(Moment.maxValue)
2.1.0 #
- Fixed LocalWeekTimeRangeandIsoWeekTimeRange'stobeing 1 microsecond ahead
- Now you can parse/serialize TimeRangeby callingTimeRange.parse()andTimeRange.toString()
2.0.2 #
- Expose PageableRange
2.0.1 #
- TimeRange
- [BREAKING] Renamed all variable/methods with "prev" to "last"
- Added HourTimeRange,LocalWeekTimeRangeandIsoWeekTimeRange, alongside with the static constructors
- [BREAKING] TimeRange's tois now exclusive. This meansDayTimeRange().durationwill equal toDuration(days:1)unless there's a daylight saving going on.
- Added next/last getters on some TimeRange classes.
 
- [BREAKING] Removes deprecated formatter tokens YYYYYYandY
- Moment.relative constructors- [BREAKING] Renamed all variable/methods with "prev" to "last"
- Added Moment.startOfThisLocalWeek(), withendOfandnext/prevvariants
- Added Moment.startOfThisIsoWeek(), withendOfandnext/prevvariants
- Added Moment.startOfThisHour(), withendOfandnext/prevvariants
 
- Added relative finder methods such as .startOfNextDay().
- Added .startOfIsoWeek()and.endOfIsoWeek()
- Exposes DateTimeConstructors(no longer need to import)
1.2.0 #
- Added getter/method to check if DateTimeis 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,DayTimeRangeor
- CustomTimeRangefor custom from/to values.
 
1.1.1 #
- es_ESlast week prefix has been fixed
- Added Portuguese localization
1.0.1 #
- Update CHANGELOG.md
1.0.0 #
Features breaking changes
- Now requires Dart v2.19.4
- Added {reference} argument to ComplexCalendarmethods- This fixes incorrect results of localizations that use ComplexCalender(i.e., zh_CN, it_IT)
 
- This fixes incorrect results of localizations that use 
- Renamed UnitStringFormtoAbbreviation
- Renamed LocalizationKotoLocalizationKoKrfor consistency
- Removed deprecated methods
- Removed weekStartfromMoment().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.nowWithTimezoneconstructor- Moment().fromNow()and- Moment.fromNowPrecise()now matches timezone with- this. Meaning, anchor will be set to UTC timezone if- thisis in UTC timezone
- Moment().calendar()now matches timezone with- this. Meaning, anchor will be set to UTC timezone if- thisis in UTC timezone
 
- DateTimeConstructors.withTimezonenow requires- isUtcas a positional argument
- Added getter Moment().hasExplicitLocalizationto 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()
 
1.0.0-rc.1 #
Features breaking changes
- Added {reference} argument to ComplexCalendarmethods- This fixes incorrect results of localizations that use ComplexCalender(i.e., zh_CN, it_IT)
 
- This fixes incorrect results of localizations that use 
- Renamed LocalizationKotoLocalizationKoKrfor consistency
- Removed deprecated methods
- Removed weekStartfromMoment().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.nowWithTimezoneconstructor- Moment().fromNow()and- Moment.fromNowPrecise()now matches timezone with- this. Meaning, anchor will be set to UTC timezone if- thisis in UTC timezone
- Moment().calendar()now matches timezone with- this. Meaning, anchor will be set to UTC timezone if- thisis in UTC timezone
 
- DateTimeConstructors.withTimezonenow requires- isUtcas a positional argument
- Added getter Moment().hasExplicitLocalizationto 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()
 
0.18.1 #
- DateTime.isSameLocalWeekAs()now uses default localization's week start if- weekStartis omitted. Closes #11
0.18.0 #
- differenceInDaysno longer forces local timezone
- Added dategetter, returns Date with hours, minutes, etc set to 0.
- Added new constructor: DateTimeConstructors.dateWithTimezone
0.17.5 #
- Calendar now accepts DateTimeas reference
- Documentation work has begun.
- See docs
- See repo on GitHub
 
0.17.4 #
- Fixed extensions, and operations copying default localization when the instance had no explicit localization
0.17.3 #
- Moment.endOfLocalWeek()and- Moment.startOfLocalWeek()now accepts- weekStartoverride, like- DateTime.~counterparts
0.17.1 #
- Fixed #9
- mn_MN, mn_Mong_MN, mn_Qaaq_MN locales now use HHinstead ofHinLT,LTSformatters
- Added 3 extension getter for MomentandDateTimeobjects.- .hour12
- .isAm
- .isPm
 
0.17.0 #
- Fixed Moment.format()
- Corrected Chinese language code (zn -> zh)
0.16.0 #
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 weekStartofDateTime().startOfLocalWeek([int weekStart])is nullable, and defaults toMoment.defaultLocalization.weekStart
- Now weekStartofDateTime().endOfLocalWeek([int weekStart])is nullable, and defaults toMoment.defaultLocalization.weekStart
0.15.0 #
- Now it's possible to set global localization with Moment.setGlobalLocalization(MomentLocalization)
- Renamed Moment.localizationtoMoment._localization, making it private, and nullable. However, this shouldn't be breaking change asMoment.localizationgetter is introduced. Getter returns instances' localization, or global localization in case the instance doesn't have set localization
0.14.0 #
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
0.13.0 #
This release has breaking changes!
- [BREAKING] endOf_()andstartOf_()now preserves the timezone instead of always returning localDateTimeobject
- endOf(DurationUnit.microsecond)and- startOf(DurationUnit.microsecond)now returns- this.clone()instead of throwing error
0.12.0 #
This release has breaking changes!
- [BREAKING] isAtSameUnit___As(other)now doesn't take timezones into account. If you want the old behaviour, useisAtSameUnit___As(other, enforceUTC: true)
- [BREAKING] Renamed MomentLocalizations.deDE()to.de()
- [BREAKING] Removed Moment().elapsed()for sake ofMoment().fromPrecise()
- [BREAKING] Now startOf_()andendOf_()no longer converts to local timezone. It just "assumes" it is in local timezone.
- All localizations are now lazy-loaded Singletons
0.11.0 #
- 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
0.10.5 #
- Fixed am/pm suffixes for mn_Mong_MNandmn_Qaaq_MN
0.10.4 #
- isSameAs_() functions timezone now depend on otherargument. Ifotheris UTC,thiswill be converted to UTC, elsethiswill be adjusted withother.timeZoneOffset
0.10.3 #
- Added .format()and other functions as extension onDateTimeobjects
- .format()now takes another optional argument- forceLocal, to convert the DateTime before formatting.
0.10.2 #
- Fixed endOfMonth() having extra days
0.10.1 #
- Fixed duration suffix in mn_MN,mn_Mong_MN,mn_Qaaq_MN
0.10.0 #
- 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 theUnitStringForm(full, mid, short respectively)- Moment.from(...)and- Moment.fromNow(...)now takes- formargument, 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
0.9.0+1 #
- Added en_US in MomentLocalizations.locales
0.9.0 #
- 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()andMomentLocalizations.byLocale()
 
- Fixed Italian localization data
0.8.2+1 #
- Updated README.md
0.8.2 #
- Added static method Moment.tryParse()
0.8.1 #
- Added .differenceInDays(other)function
- DurationExtraextension on- Duration
- Added new locale: Italian (it) (Italy)
- Refactored relative times in Indo-European languages, and bunch of other stuff
0.8.0 #
- MomentLocalizationhas gotten major updates, making it easier to implmement new localizations:- No longer requires to override .calendar(...)
- Requires to override these new functions/getters: calendarData,weekdayName,overrideFormatters
- Restructured formatters. No need to override formatter for every FormatterToken
 
- No longer requires to override 
- Removed following deprecated methods: Moment.lastMondayAsDateTime(),Moment.lastSundayAsDateTime()
- Implemented .endOf(DurationUnit unit), and it's children.endOf~~~(). Works on bothMomentandDateTime
- Added new locales:
- Spanish (es) (Spain)
- French (fr) (France)
 
- Minor changes:
- No longer produces debug stdouts, deprecating enableDebugPrint()
 
- No longer produces debug stdouts, deprecating 
0.7.3 #
- Added shorthand function for commonly used tokens. For example, moment.LT, moment.LTS, moment.L, etc.
0.7.2 #
- Updated README.md
0.7.1 #
- Moment.format()no longer has required positional argument. Optional positional argument defaults to- l;
0.7.0 #
- IMPORTANT CHANGE: Now MomentextendsDateTimeclass
- IMPORTANT CHANGE: Now targets Dart version 2.17.0 and above
- Implemented 6 operators (+, -, <, <=, >=, >) for DateTimeandMoment. Part of MomentBenefits extension
- Implemented .lastWeekday(int weekday), and it's children.lastMonday(),.lastTuesday(), ...,.lastSunday(). You can also do same thing to find future weekdays. For example,.nextMonday(). Works on bothMomentandDateTime
- Implemented .startOf(DurationUnit unit), and it's children.startOf~~~(). Works on bothMomentandDateTime
0.6.2 #
- Now Mongolian singular units include number 1as nature of the language is not similar to English. For example,минутын өмнө=>1 минутын өмнө
- Mongolian script with Mongolian numbers (mn_TM_tn)'s.relative(-)now uses Mongolian numbers
0.6.1 #
- Fixed Mongolian mn_MNand Mongolian Scriptmn_TMsuffixes
0.6.0+2 #
- Updated README.md
0.6.0+1 #
- Updated README.md
0.6.0 #
- Added comparison functions (isAtSame_As(other))
- Removed unwanted console logs
- Updated README.md
0.5.0 #
- Now it's possible to escape strings in Moment.format(). Encapsulate the text in square brackets ([]) to do so.
- Fixed calendar relative week miscalculations
- Changed localization default date format from Ltol(shortened version)
0.4.2 #
- Fixed number word gender-dependent suffix in Mongolian languages. (mn_MN,mn_MNtraditional mongolian)
0.4.1 #
- Made major fixes in de_DElocalization
- Implemented all DateTimefunctions inMomentclass
- Implemented MomentBenefitsextension functions inMomentclass
0.4.0 #
- Exposed localizations' classes
- Fixed Yesterday/Tomorrow calculation. It was horrible :(((
- Other major fixes in localizations
0.3.0 #
- Now localizations are listed as static functions in MomentLocalizationsclass. Providing easier access
- Made fixes in ko_KO,de_DElocalizations
- Includes endonym, language code, locale, English name in localization classes
0.2.0+2 #
- No longer prints the matched tokens
0.2.0 #
- Removed debug prints when using .format(String payload). You can re-enable it by calling.enableDebugPrint()on the Moment instance
- Exposed experimental Korean (ko_KO), German (de_DE) localizations
- Added localization aware formatters: L, LL, LLL, LLLL, LT, LTS
- Removed localizationDefaultDateFormat(),localizationDefaultHourFormat()fromMomentLocalizationin favor of localization aware formatter
- Revised some localizations
0.1.5 #
- Added MomentBenefits extenstion usage on README
- Testing on MomentBenefits extension
- Bugfixes
0.1.4+1 #
- Exposed the MomentLocalization
0.1.4 #
- Exposed the localization in Momentclass
- Added DateTime.toMoment({MomentLocalization: localization})function as extension onDateTime
0.1.3+1 #
- Exported localizations to localizations/all.dart, and exposed it in the main file
0.1.3 #
- Started work of Korean (ko_KO) and German (de_DE) localizations
- Renamed LocalizationtoMomentLocalizationfor the sake of universe
0.1.2 #
- Improved Moment.formattokenization
- Moment.calendernow allows- customFormat, which can be used instead of the localization's default format.
- Fixes
0.1.1 #
- Fixed Moment.formatfunction
- Fixed negative sign appearing in relative date texts
0.1.0 #
- Initial beta release.