Skip to content

@serenity-is/corelib / initFlatpickrLocale

Function: initFlatpickrLocale()

initFlatpickrLocale(flatpickr): void

Defined in: src/compat/init-global-mappings.ts:182

Localizes a flatpickr instance to the document language.

Parameters

flatpickr

any

flatpickr module/instance with a l10ns dictionary and localize method; no-op if missing l10ns.

Returns

void

Remarks

Reads document.documentElement.lang (falls back to "en"), tries the full locale (e.g. "tr-tr") then the base language (e.g. "tr") if available in flatpickr.l10ns. Called automatically by initGlobalMappings when a flatpickr module is provided.

Example

initFlatpickrLocale(flatpickr);