weekOfYear property

int weekOfYear

Returns the week of the year based on the current Locale's start of week.

The week of the year ranges from 1 to 53, where week 1 is the first week that has at least DateTime.daysPerWeek days in the new year.

For example, in the United States, weeks typically start on Sunday. If date and time is a Monday in the second week of the year (For example, 8 days after the start of the year), the method returns 2. On the other hand, in France, weeks typically start on Monday. If date and time is a Sunday in the first week of the year (For example, 6 days after the start of the year), the method returns 1.

Implementation

int get weekOfYear => _getter.weekOfYear(dateTime, _locale.startOfWeek());