Check documentation for the latest version of dhtmlxSuite setCalendarDateFormat DHTMLX Docs

setCalendarDateFormat

sets the format of date presentation in the calendar input

void setCalendarDateFormat(string name,string dateFormat,string serverDateFormat);
namestringthe item's name
dateFormatstringthe format in which dates will be presented on the client
serverDateFormatstringthe format in which dates will be passed to/loaded from the server

Example

myForm.setCalendarDateFormat(name, "%d/%m/%y", "%d/%m/%y");

Details

Format string can contain any separator character and any element from the following list:

  • %d - day as a number ( with leading zero );
  • %j - day as a number;
  • %D - abbreviated name of the day;
  • %l - full name of the day;
  • %m - month as a number ( with leading zero );
  • %n - month as a number;
  • %M - abbreviated name of the month;
  • %F - full name of the month;
  • %y - year as a number (2 digits);
  • %Y - year as a number (4 digits);
  • %h - hours (12);
  • %H - hours (24);
  • %i - minutes;
  • %s - seconds;
  • %a - am or pm;
  • %A - AM or PM.

For example, if you want to set 1st June 2011 as 01.06.2011, the following format should be specified:

myForm.setCalendarDateFormat("cal1","%d.%m.%Y","%d.%m.%Y");
Back to top