No gainsay implied in my last , but simply that it reminded me of discussion when
Date.weekday was added - i.e. issues of whether Sunday or Monday is day #1, plus locale differences, etc. I know dates get complex - and I’m not an expert. This might help explain the difference I allude to above. My (limited) understanding is the week-of-the-year is a more business/giv concept and probably derives from things like payroll calculation.
Thus, 1 Jan is not necessarily the beginning of the first week of the year and so if
weeks(1/1/2018,today) gives the differing number of days divided/7 (I presume) thismay not always mesh with the first week of the year. 1 Jan will (should!) always be in the first week of the year, but 7 Jan may not be so. My presumption was
weeks(date1,date2) would give you the integer week different whilst
Date.weekOfYear would work based on the current locale’s first week of the year. The two may be the same, but not always. I guess it depends which ‘week’ definition one is after.
FWIW, if we’re adding more date-based utilities I’d go for both
Date.weekOfYear so the user has the choice of appropriate calculation.