HeaderPane
Main
Hide
Share Link
Print

GetOptionalCalendars

Retrieves the calendar systems a locale offers that SftDate/DLL supports.

C

int SftDate_GetOptionalCalendars(LPCTSTR lpszLocaleName, CALID* lpCalendars, int maxCount);
int WINAPI SftDate_GetOptionalCalendars_A(LPCSTR lpszLocaleName, CALID* lpCalendars, int maxCount);
int WINAPI SftDate_GetOptionalCalendars_W(LPCWSTR lpszLocaleName, CALID* lpCalendars, int maxCount);

C++

static int CSftDate::GetOptionalCalendars(LPCTSTR lpszLocaleName, CALID* lpCalendars, int maxCount);
static int CSftCalendar::GetOptionalCalendars(LPCTSTR lpszLocaleName, CALID* lpCalendars, int maxCount);

Parameters

lpszLocaleName

The locale name, such as "ja-JP" or "ar-SA". NULL or an empty string selects the user's locale.

lpCalendars

A pointer to an array of CALID values that receives the calendars, or NULL.

maxCount

The number of elements of the array lpCalendars.

Returns

The return value is the number of calendars the locale offers, even if it exceeds maxCount. 0 is returned if the locale name is not valid.

Comments

The GetOptionalCalendars function retrieves the calendar systems a locale offers, in the order Windows lists them, with the default calendar of the locale first. Calendars that SftDate/DLL doesn't support are not included.

Each calendar returned can be used with SetCulture. For example, "ja-JP" offers the Gregorian and the Japanese calendars.

GetOptionalCalendars doesn't use a control and can be called at any time.

SftDate.h maps the name without suffix to the _A (ANSI) or _W (Unicode) function, depending on whether UNICODE or _UNICODE is defined. The ANSI functions convert the text using the system code page.

See Also C/C++ API | Categories | Notifications


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