due_date 2.0.0 copy "due_date: ^2.0.0" to clipboard
due_date: ^2.0.0 copied to clipboard

A package for working with repeating DateTime patterns (like the same day every month).

example/README.md

Example #

A simple command line application that showcases the base usage for the due_date package.

import 'package:due_date/due_date.dart';

void main(List<String> arguments) {
  final date = DateTime(2022, DateTime.january, 31);
  DueDateTime dueDate = date.dueDateTime;
  print(dueDate.toString()); // 2022-01-31
  dueDate = dueDate.next;
  print(dueDate.toString()); // 2022-02-28
  dueDate = dueDate.next;
  print(dueDate.toString()); // 2022-03-31

  DueDateTime dueDate2 = DueDateTime.fromDate(
    date,
    EveryWeekdayCountInMonth(
      day: Weekday.friday,
      week: Week.last,
    ), // WeekdayOccurrence.lastFriday
  );
  print(dueDate2.toString()); // 2022-02-25
  dueDate2 = dueDate2.next;
  print(dueDate2.toString()); // 2022-03-25
  dueDate2 = dueDate2.next;
  print(dueDate2.toString()); // 2022-04-29
}
6
likes
130
pub points
26%
popularity

Publisher

unverified uploader

A package for working with repeating DateTime patterns (like the same day every month).

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (LICENSE)

Dependencies

collection, equatable, intl, time

More

Packages that depend on due_date