firstDayOfWeek property

DateTime firstDayOfWeek

Implementation

DateTime get firstDayOfWeek {
  /// Handle Daylight Savings by setting hour to 12:00 Noon
  /// rather than the default of Midnight
  final day = DateTime.utc(year, month, this.day, 12);

  /// Weekday is on a 1-7 scale Monday - Sunday,
  /// This Calendar works from Sunday - Monday
  final decreaseNum = day.weekday % 7;
  return subtract(Duration(days: decreaseNum));
}