@uplink-protocol/calendar-controller
Version:
Flexible calendar and time picker API supporting both calendar, date-picker, and time-picker integrations for any JavaScript framework or library
55 lines (54 loc) • 1.84 kB
TypeScript
import { ILocalizationService } from '../interfaces/localization.service.interfaces';
/**
* Implementation of LocalizationService
* Responsible for providing internationalization and localization functions
*/
export declare class LocalizationService implements ILocalizationService {
private _locale;
/**
* Constructor with optional locale
* @param locale Initial locale
*/
constructor(locale?: string);
/**
* Get localized month names
* @param short Whether to get short month names
* @returns Array of month names
*/
getMonthNames(short?: boolean): string[]; /**
* Get localized weekday names
* @param short Whether to get short weekday names
* @param firstDayOfWeek First day of week (0 = Sunday, 1 = Monday, etc.)
* @returns Array of weekday names
*/
getWeekdayNames(short?: boolean, firstDayOfWeek?: number): string[];
/**
* Get short localized weekday names
* @param firstDayOfWeek First day of week (0 = Sunday, 1 = Monday, etc.)
* @returns Array of short weekday names
*/
getShortWeekdayNames(firstDayOfWeek?: number): string[];
/**
* Get current locale
* @returns Current locale string
*/
getLocale(): string;
/**
* Set locale
* @param locale Locale string (e.g., 'en-US', 'fr-FR')
*/
setLocale(locale: string): void;
/**
* Format a date according to the locale
* @param date Date to format
* @param options Intl.DateTimeFormatOptions
* @returns Formatted date string
*/
formatDate(date: Date, options?: Intl.DateTimeFormatOptions): string;
/**
* Get the week number of the given date according to the locale.
* @param date Date to get the week number for
* @returns Week number (1-based)
*/
getWeekNumber(date: Date): number;
}