selects a date in the calendar

boolean setValue(Date|Date[]|string|string[] date);


dateDate|Date[]|string|string[]the date to select


booleandefines, whether a date has been successfully added into the calendar


// sets the current date
calendar.setValue(new Date());
// sets the current date as an array of Date value
calendar.setValue([new Date()]);
// sets a date as a string
// sets a date as an array of string value
//sets dates as an array of Date values(for the range mode)
calendar.setValue([new Date(2019,05,03), new Date(2019,05,19)]);
//sets dates as an array of string values(for the range mode)
calendar.setValue(["03/06/19", "15/06/19"]);

Related samples


Please note that the format of date in the Calendar is defined by the dateFormat option. So, check that you've set the format of date you want to use in the calendar both in the setValue() method and in the dateFormat property. Otherwise, the default format ("%d/%m/%y") will be used.

See also
Back to top