DHTMLX Docs & Samples Explorer

setFormatedDate(format, date)

Makes the date defined in the specified format selected.

Parameters:

  • format - the custom date format string. If the parameter is omitted, the currently set date format will be used.
  • date - the date in the format specified by the first parameter.

    myCalendar.setFormatedDate("%d/%m/%y", "03/06/2011"); //selects the  3rd June 2011

Description:

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

  • %d - day as number ( with leading zero );
  • %j - day as number;
  • %D - abbreviated name of the day;
  • %l - full name of the day;
  • %m - month as number ( with leading zero );
  • %n - month as number;
  • %M - abbreviated name of the month;
  • %F - full name of the month;
  • %y - year as number (2 digits);
  • %Y - year as 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 select 1st June 2011 and specify this date as 01.06.2011, you should use the following code:

myCalendar.setFormatedDate("%d.%m.%Y", "01.06.2011")

See also: