Skip to main content

dateFormat

Optional. Defines the format of dates in Calendar

dateFormat?: string;

Default value: "%d/%m/%y"

Example

const calendar = new dhx.Calendar("calendar_container", {
dateFormat:"%d.%m.%Y"
});

Related sample: Calendar. Date format

info

The date format must include delimiters (space or symbol), otherwise an error will be thrown.

DHTMLX Calendar uses the following characters for setting a date format:

CharacterDefinition
%dday as a number with leading zero, 01..31
%jday as a number, 1..31
%Dshort name of the day, Su Mo Tu...
%lfull name of the day, Sunday Monday Tuesday...
%mmonth as a number with leading zero, 01..12
%nmonth as a number, 1..12
%Mshort name of the month, Jan Feb Mar...
%Ffull name of the month, January February March...
%yyear as a number, 2 digits
%Yyear as a number, 4 digits
%hhours 12-format with leading zero, 01..12)
%ghours 12-format, 1..12)
%Hhours 24-format with leading zero, 00..23
%Ghours 24-format, 0..23
%iminutes with leading zero, 01..59
%sseconds with leading zero, 01..59
%aam or pm
%AAM or PM
%umilliseconds