Last updated:
0 purchases
railsy time
A collection of extensions methods for [DateTime], [Duration], and [int] to allow
for easier date and time calculations.
Features #
Turns integers into [Duration] objects.
Easily get [DateTime] objects in the past or future from a [Duration].
Get related dates and times for a [DateTime].
Getting started #
Installation #
# pubspec.yaml
dependencies:
railsy_time: ^1.0.0 # Check out the latest version
copied to clipboard
Usage #
import '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 year
copied to clipboard
License #
MIT License, see the LICENSE.md file for details.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.