A collection of extensions methods for DateTime, Duration, and int to allow
for easier date and time calculations.
- Turns integers into
Durationobjects. - Easily get
DateTimeobjects in the past or future from aDuration. - Get related dates and times for a
DateTime.
# pubspec.yaml
dependencies:
railsy_time: ^1.0.0 # Check out the latest versionimport 'package:railsy_time/railsy_time.dart';
3.days.fromNow
// equal to DateTime.now().add(Duration(days: 3))
14.days.ago.beginningOfWeek
// 00:00:00.000000 on the Monday 2 weeks ago
DateTime.now().endOfYear
// 23:59:59.999999 on December 31st of the date's yearMIT License, see the LICENSE file for details.