Product Site

5.4.6.24. weeksInYear

Returns the number of weeks in this date's year according to the ISO week number rules.

There are either 52 or 53 ISO weeks in any given year.

See also methods weekNumber, weekNumberYear, and weekNumberDate.

Example 5.235. DateTime class — weeksInYear method
do year = 2010 to 2030
  d = .DateTime~new(year, 6, 30)
  if d~weeksInYear \= 52 then
    say year":" d~weeksinYear -- 2015: 53, 2020: 53, 2026: 53
end