Показать сообщение отдельно
Старый 09.03.2011, 12:38   #3  
George Nordic is offline
George Nordic
Модератор
Аватар для George Nordic
Злыдни
 
4,480 / 1255 (50) ++++++++
Регистрация: 17.12.2003
Адрес: Moscow
Записей в блоге: 9
Еще интереснее:
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.
Там комментариев больше чем кода Рефакторинг блин...
А толку-то...

С Уважением,
Георгий
За это сообщение автора поблагодарили: mifi (-1).