DateRange.week constructor

DateRange.week(
  1. DateTime value, {
  2. int? firstWeekday,
})

Создает промежуток в 1 неделю. Creates 1 week range.

For the start will be used 00:00 of the first day of the week, which contains value.

You can define first weekday (Monday, Sunday or Saturday) with parameter firstWeekday. It should be one of the constant values DateTime.monday, ..., DateTime.sunday.

By default it's DateTime.monday.

Implementation

DateRange.week(DateTime value, {int? firstWeekday})
    : this(
        DateTimeUtils.firstDayOfWeek(value, firstWeekday: firstWeekday),
        DateTimeUtils.firstDayOfNextWeek(value, firstWeekday: firstWeekday),
      );