date_range_common 0.1.0 copy "date_range_common: ^0.1.0" to clipboard
date_range_common: ^0.1.0 copied to clipboard

discontinued

DateRange class for the Date Range Picker package (the point is to allow to use the same data type between AngularDart and Flutter)

example/main.dart

import 'package:date_range_common/date_range_common.dart';

void main() {
  /// Returns DateRange containing last week period
  DateRange.lastWeek();

  /// Returns DateRange containing last month period
  DateRange.lastMonth();

  /// Returns DateRange containing the past 7 days
  DateRange.pastSevenDays();

  /// Returns DateRange containing the past 28 days
  DateRange.pastTwentyHeightDays();

  /// This will work perfectly fine
  final DateRange customRange =
      DateRange(DateTime.now(), DateTime.now().add(Duration(days: 5)));

  /// And you can get the duration between both date with:
  customRange.getDuration();

  /// This will throw an error because the last date must be at least equal to the first date!
  DateRange(DateTime.now(), DateTime.now().subtract(Duration(days: 1)));
}
1
likes
40
pub points
1%
popularity

Publisher

verified publishergaspardmerten.dev

DateRange class for the Date Range Picker package (the point is to allow to use the same data type between AngularDart and Flutter)

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

More

Packages that depend on date_range_common