@mui/x-date-pickers
Version:
The community edition of the MUI X Date and Time Picker components.
33 lines • 1.15 kB
TypeScript
import dayjs, { Dayjs } from 'dayjs';
import { AdapterDayjs } from "../AdapterDayjs/index.js";
import { AdapterOptions } from "../models/index.js";
declare module '@mui/x-date-pickers/models' {
interface PickerValidDateLookup {
'dayjs-buddhist': Dayjs;
}
}
/**
* Adapter for dayjs with Buddhist Era calendar support.
* Buddhist Era is used in Thailand and other Southeast Asian countries.
* It uses the same months and days as the Gregorian calendar but with a year offset of 543.
*/
export declare class AdapterDayjsBuddhist extends AdapterDayjs {
constructor({
locale,
formats
}?: AdapterOptions<string, never>);
/**
* Returns the Buddhist year (Gregorian year + 543)
*/
getYear: (value: Dayjs) => number;
/**
* Sets the Buddhist year (converts to Gregorian year internally)
*/
setYear: (value: Dayjs, year: number) => dayjs.Dayjs;
/**
* Parses a date string with Buddhist year support.
* The buddhistEra plugin only supports formatting, not parsing,
* so we convert BBBB/BB to YYYY/YY and adjust the year after parsing.
*/
parse: (value: string, format: string) => dayjs.Dayjs | null;
}