tempo 0.7.1
tempo: ^0.7.1 copied to clipboard
A complete time and date solution that replaces Dart's core DateTime with a rich set of date and time classes, advanced arithmetic features and full time zone support.
Changelog #
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.7.0 - 2025-08-02 #
Added #
- Missing conversion methods, and standardized the existing ones (see the library docs for a list of conversion method names)
- New ISO 8601
parse()constructors forInstantandZonedDateTime - Parses ISO date times with either a space or no separator instead of a 'T'
Changed #
- Breaking:
ZonedDateTime.defaultZoneIdmoved to a top-level getter/setter pair - Setting
defaultZoneIdto an invalid value now throws an exception - Breaking:
ZonedDateTime.toOffset()changed to a getter,asOffsetDateTime - Breaking:
toDateTime()no longer a part of theHasDateinterface - Breaking:
HasInstantnow usestoInstant()method instead ofasInstantgetter - Breaking:
OffsetDateTimenow defaults todefaultZoneIdinstead of UTC:- Removed
offsetarg from the unnamed constructor. UsewithOffsetconstructor instead - All other
offsetconstructor and conversion method args are now optional and default to the time zone indefaultZoneId - One exception: the
fromDateTimeconstructor continues to use the offset from theDateTimeit's given
- Removed
Removed #
- Breaking: All
asInstantgetters removed. UsetoInstant()instead.
Fixed #
- Breaking: DateTime extension method
toLocal()renamed totoLocalDateTime()so it doesn't shadow an existing method - Test matchers
hasDateandhasTimeno longer ignore unspecified fields, and instead check for expected defaults. For example,expect(LocalTime(4, 30), hasTime(4))used to pass. Now it fails, since the unspecified minute matcher defaults to 0.
0.6.0 - 2025-06-11 #
Added #
- Added
usandisogetters to Weekday for weekday numbers - Added extension methods on DateTime and Duration to convert to Tempo objects
Changed #
- Minimum Dart SDK is now 3.0.0
- Made zoneId optional for ZonedDateTime creation. This is seamless with one exception (see below)
- Breaking: Removed zoneId arg from ZonedDateTime(). Use ZonedDateTime.withZoneId() if you want to specify a time zone.
- ZonedDateTime now has a settable defaultZoneId field that will be used if none is provided.
- Improved documentation; assigned objects to categories and created category documentation pages.