DateTimeSC extension

Supercharged extension on DateTime objects.

on

Methods

duration() Duration
Returns the Duration from 01.01.1970 (epoch/unix time) until this.
isBetween(DateTime from, DateTime to) bool
Returns the bool wheather the given date are inside iterval or not.
rangeTo(DateTime to, {Duration by = const Duration(days: 1)}) Iterable<DateTime>
Returns a lazy Iterable<DateTime> that contains all dates from this to to including the dates this and to.
until(DateTime to, {Duration by = const Duration(days: 1)}) Iterable<DateTime>
Returns a lazy Iterable<DateTime> that contains all dates from this to to including this but excluding to.

Operators

operator +(Duration duration) DateTime
Returns a new DateTime object having added the given duration.
operator -(Duration duration) DateTime
Returns a new DateTime object having subtracted the given duration.