HeaderPane
Main
Hide
Share Link
Print

Week Numbers

With SftDate_SetShowWeekNumbers set to TRUE, a calendar shows the number of each week in front of it, in the SFTDATE_COLOR_WEEKNUMBERFORE and SFTDATE_COLOR_WEEKNUMBERBACK colors. SftDate_SetWeekNumberRule defines how the numbers are calculated:

ValueWeek Numbers
SFTDATE_WEEKRULE_CULTURE (default)The first-week-of-the-year rule of the culture and the calendar's first day of the week.
SFTDATE_WEEKRULE_ISO8601ISO 8601: weeks start on Monday and week 1 contains the first Thursday of the year. Each row shows the number of the week its Thursday belongs to; set the first day of the week to SFTDATE_FIRSTDAY_MONDAY so the rows are the ISO weeks.

SftDate_SetShowWeekNumbers(hwndCalendar, TRUE);
SftDate_SetWeekNumberRule(hwndCalendar, SFTDATE_WEEKRULE_ISO8601);
SftDate_SetFirstDayOfWeek(hwndCalendar, SFTDATE_FIRSTDAY_MONDAY);

SftDate_SetFirstDayOfWeek defines the first day of the week, SFTDATE_FIRSTDAY_SUNDAY to SFTDATE_FIRSTDAY_SATURDAY. SFTDATE_FIRSTDAY_DEFAULT (the default) uses the first day of the culture.

In an SftCalendar control in range mode, a click on a week number selects the week (see Date Ranges).


Last Updated 11/26/2026 - (email)
© 2026 Softel vdm, Inc.