Calculating week number

from Pawel Soltysinski

The only thing I need to update is week number, since in EU there is ISO week number norm, which is not equal to Date.WeekOfYear in Xojo. ISO week date - Wikipedia

if anyone interested, here’s my method for it:

Public Function ISOWeekNumber(extends dt as date) As integer
  // ISO 8601 week number
  var dow,woy as UInt8
  if dow=0 then dow=7
  if woy=0 then
    var dp as new date (dt.Year-1,12,31)
    if dow=0 then dow=7
  elseif woy=53 then
    var dp as new date (dt.Year+1,1,1)
    if dow<6 and dow>1 then woy=1
  end if
  Return woy
End Function

source nov 2022