HeaderPane
Main
Hide
Share Link
Print

FirstDayOfWeek

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);

Parameters

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_DEFAULTThe first day of the week of the culture (SetCulture). This is the default.
SFTDATE_FIRSTDAY_SUNDAYSunday.
SFTDATE_FIRSTDAY_MONDAYMonday.
SFTDATE_FIRSTDAY_TUESDAYTuesday.
SFTDATE_FIRSTDAY_WEDNESDAYWednesday.
SFTDATE_FIRSTDAY_THURSDAYThursday.
SFTDATE_FIRSTDAY_FRIDAYFriday.
SFTDATE_FIRSTDAY_SATURDAYSaturday.

Returns

GetFirstDayOfWeek returns the setting, one of the values listed above.

SetFirstDayOfWeek returns TRUE if the value is valid, otherwise FALSE.

Comments

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.

Examples

C View entire sample code

    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)

C++ View entire sample code

    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


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