WeekConfig class

Configuration for week calculations.

Controls the first day of the week and the minimum number of days required in the first week of the year.

// ISO 8601: Monday start, 4-day threshold
WeekConfig.iso

// US convention: Sunday start, Jan 1 always in week 1
WeekConfig.us

// From locale
WeekConfig.fromLocale(hora.locale)

// Custom
WeekConfig(firstDayOfWeek: DateTime.saturday, minDaysInFirstWeek: 1)
Annotations
  • @immutable

Constructors

WeekConfig({int firstDayOfWeek = DateTime.monday, int minDaysInFirstWeek = 4})
Creates a week configuration.
const
WeekConfig.fromLocale(HoraLocale locale)
Creates a WeekConfig from a HoraLocale.
factory

Properties

firstDayOfWeek int
The first day of the week (1 = Monday, 7 = Sunday).
final
hashCode int
The hash code for this object.
no setteroverride
minDaysInFirstWeek int
Minimum days required in the first week of the year.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Constants

iso → const WeekConfig
ISO 8601 configuration (Monday start, 4-day first week threshold).
us → const WeekConfig
US configuration (Sunday start, Jan 1 always in week 1).