Converter
Converter instance for convert date to datepicker's locale format
Methods
format
Convert date to given format string.
(value: any, format: string) => string;
value- The date to format. If date value is not valid, function will return givenformat.format- The format string to convert. (e.g.YYYY-MM-DD). dateFormat options can be used.
Get the formatted date according to the string.
If you want to pass escape characters, you can use square brackets to wrap the text.
(e.g. YYYY [escaped text] MM will output 2024 escaped text 01)
YY2-digit yearYY12-digit year of the first year in current decadeYY22-digit year of the last year in current decadeYYYYfull yearYYYY1full year of the first year in current decadeYYYY2full year of the last year in current decadeMmonthMMmonth with leading zeroMMMshort month nameMMMMfull month nameDdayDDday with leading zerodweekday indexddmin weekday namedddshort weekday nameddddfull weekday name
time
Convert date to time format string.
(value: any) => string;
value- The date to format.
date
Convert date to date format string.
(value: any) => string;
value- The date to format.
localeMonth
Convert month index to locale month name.
(monthindex: number, short?: boolean) => string;
monthindex- The month index to convert.short- Iftrue, short month name will be returned.
localeWeekday
Convert weekday index to locale weekday name.
(weekdayindex: number, options?: 'short' | 'min') => string;
weekdayindex- The weekday index to convert.options- Ifshort, short weekday name will be returned. Ifmin, min weekday name will be returned.