due_date 2.2.2 copy "due_date: ^2.2.2" to clipboard
due_date: ^2.2.2 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
}
8
likes
140
points
322
downloads

Publisher

verified publisherfmorschel.dev

Weekly Downloads

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

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#date #datetime #date-time #time #calendar

Documentation

API reference

Funding

Consider supporting this project:

github.com
www.buymeacoffee.com

License

MIT (license)

Dependencies

clock, collection, equatable, meta, time

More

Packages that depend on due_date