Еще интереснее:
X++:
info(strfmt("d3:%1",WeekOfYear(21\12\2012))); //52
info(strfmt("d4:%1",WeekOfYear(30\12\2012))); //53
Хотя между 21 и 30 явно больше 7 дней
Вау! Да класс global рулит! static int weekOfYear(date _curDate)
Цитата:
// The dayofwk function used above returns
// the ISO-8601 day of week, where Monday is 1
// and recall that the 1 was subtracted from the result
// to get a value between (0 - 6).
//
// If the locale settings (firstDayOfWeek) is
// not Monay (i.e. > 0) then the caclulated
// day of week results need to be adjusted
// so they align with the locale setting.
Там комментариев больше чем кода

Рефакторинг блин...
А толку-то...
С Уважением,
Георгий