Weeks are calculated according to the standard ISO 8601.
The first week of the year is the week which contains the first Thursday of the year, or, equivalently, the week that contains the January 4 . I.e. if the first of January falls on Friday, Saturday, or Sunday, the last week of the previous year still lasts. This can lead to interesting special effects - the year can contain 52 or 53 weeks. 29th, 30th, 31st of December can be part of the first week of next year. Or January 1, 2, and January 3 can belong to 52nd or 53rd week of last year.Last week of this year