time 2.1.5 time: ^2.1.5 copied to clipboard
Type-safe DateTime and Duration calculations, powered by extensions.
2.1.5 #
- Introduce
endOfDay
extension toDateTime
2.1.4 #
- Introduce
shift
extension toDateTime
2.1.3 #
- Introduce
isWeekend
extension toDateTime
- Introduce
isWorkday
extension toDateTime
2.1.2 #
- Fix
min
andmax
assertion withclamp
extension
2.1.1 #
- Introduce
firstDayOfWeek
extension toDateTime
- Introduce
lastDayOfWeek
extension toDateTime
- Introduce
firstDayOfMonth
extension toDateTime
- Introduce
lastDayOfMonth
extension toDateTime
- Introduce
firstDayOfYear
extension toDateTime
- Introduce
lastDayOfYear
extension toDateTime
- Introduce
clamp
extension toDateTime
- Introduce
clamp
extension toDuration
2.1.0 #
- Introduce
package:clock
dependency for more predictable testing
2.0.1 #
- Implement utc support for
copyWith
operation
2.0.0 #
- Migrate to null-safety
1.5.0-nullsafety.1 #
- Introduce
isAtSameYearAs
extension toDateTime
- Introduce
isAtSameMonthAs
extension toDateTime
- Introduce
isAtSameDayAs
extension toDateTime
- Introduce
isAtSameHourAs
extension toDateTime
- Introduce
isAtSameMinuteAs
extension toDateTime
- Introduce
isAtSameMillisecondAs
extension toDateTime
- Introduce
isAtSameMicrosecondAs
extension toDateTime
- Introduce
isLeapYear
extension toDateTime
- Introduce
daysInMonth
extension toDateTime
final DateTime specificDate = DateTime(2021, 01, 01);
final DateTime otherDate = DateTime(2021, 02, 01);
print(specificDate.isAtSameYearAs(otherDate)); // true
print(specificDate.isAtSameMonthAs(otherDate)); // false
print(specificDate.isAtSameDayAs(otherDate)); // false
1.4.1 #
- Introduce
isAtSameYearAs
extension toDateTime
- Introduce
isAtSameMonthAs
extension toDateTime
- Introduce
isAtSameDayAs
extension toDateTime
- Introduce
isAtSameHourAs
extension toDateTime
- Introduce
isAtSameMinuteAs
extension toDateTime
- Introduce
isAtSameMillisecondAs
extension toDateTime
- Introduce
isAtSameMicrosecondAs
extension toDateTime
- Introduce
isLeapYear
extension toDateTime
- Introduce
daysInMonth
extension toDateTime
1.5.0-nullsafety.0 #
- Migrated to null-safe dart
1.4.0 #
- Introduce
isToday
extension toDuration
- Introduce
isTomorrow
extension toDateTime
- Introduce
wasYesterday
extension toDateTime
1.3.0 #
- Introduce
delay
extension toDuration
- Introduce
copyWith
extension toDateTime
1.2.0 #
- Iterate through a
DateTime
range:
final DateTime start = DateTime(2019, 12, 2);
final DateTime end = start + 1.weeks;
final DateTime tuesday = start.to(end).firstWhere((date) => date.weekday == DateTime.tuesday);
1.1.1 #
- Fix breaking change from v1.1.0 by introducing @deprecated flag
1.1.0 #
- Breaking Change: renamed
later
tofromNow
to align with other ecosystems - Introduced support for other variants of
num
i.edouble
1.0.0 #
- Named extensions to allow discoverability
- Introduced quality control test cases
0.0.1+1 #
- Unify extensions for int, Duration & DateTime
0.0.1 #
- Initial version