Defines the day shown in the first column of a month.
C
int WINAPI SftDate_GetFirstDayOfWeek(HWND hwndCtl); BOOL WINAPI SftDate_SetFirstDayOfWeek(HWND hwndCtl, int day);
C++
int CSftDate::GetFirstDayOfWeek() const; int CSftCalendar::GetFirstDayOfWeek() const; BOOL CSftDate::SetFirstDayOfWeek(int day); BOOL CSftCalendar::SetFirstDayOfWeek(int day);
hwndCtl
The window handle of the month calendar control (SftCalendar), or of the date field control (SftDate) whose dropdown calendar is affected.
day
Defines the first day of the week. day can be one of the following values:
| SFTDATE_FIRSTDAY_DEFAULT | The first day of the week of the culture (SetCulture). This is the default. |
| SFTDATE_FIRSTDAY_SUNDAY | Sunday. |
| SFTDATE_FIRSTDAY_MONDAY | Monday. |
| SFTDATE_FIRSTDAY_TUESDAY | Tuesday. |
| SFTDATE_FIRSTDAY_WEDNESDAY | Wednesday. |
| SFTDATE_FIRSTDAY_THURSDAY | Thursday. |
| SFTDATE_FIRSTDAY_FRIDAY | Friday. |
| SFTDATE_FIRSTDAY_SATURDAY | Saturday. |
GetFirstDayOfWeek returns the setting, one of the values listed above.
SetFirstDayOfWeek returns TRUE if the value is valid, otherwise FALSE.
The GetFirstDayOfWeek and SetFirstDayOfWeek functions define and retrieve the day of the week shown in the first column of each month.
Week numbers (SetShowWeekNumbers) using the culture's rule follow the first day of the week; ISO 8601 week numbers always start on Monday (SetWeekNumberRule).
The setting applies to a month calendar control and to the dropdown calendar of a date field control.
case IDC_WEEKNUMBERS:
for (i = 0; i < CONTROLS; ++i) {
SftDate_SetShowWeekNumbers(c[i], sel > 0);
SftDate_SetWeekNumberRule(c[i], sel == 2 ? SFTDATE_WEEKRULE_ISO8601 : SFTDATE_WEEKRULE_CULTURE);
}
break;
case IDC_FIRSTDAY:
for (i = 0; i < CONTROLS; ++i)
SftDate_SetFirstDayOfWeek(c[i], sel);
break;
case IDC_VIEWS:
for (i = 0; i < CONTROLS; ++i)
SftDate_SetAllowedViews(c[i], g_viewSets[sel]);
break;
case IDC_TRAILING:
for (i = 0; i < CONTROLS; ++i)
case IDC_WEEKNUMBERS:
for (int i = 0; i < CONTROLS; ++i) {
Control(i).SetShowWeekNumbers(sel > 0);
Control(i).SetWeekNumberRule(sel == 2 ? SFTDATE_WEEKRULE_ISO8601 : SFTDATE_WEEKRULE_CULTURE);
}
break;
case IDC_FIRSTDAY:
for (int i = 0; i < CONTROLS; ++i)
Control(i).SetFirstDayOfWeek(sel);
break;
case IDC_VIEWS:
for (int i = 0; i < CONTROLS; ++i)
Control(i).SetAllowedViews(g_viewSets[sel]);
break;
case IDC_TRAILING:
for (int i = 0; i < CONTROLS; ++i)See Also C/C++ API | Categories | Notifications