showDate

shows a specified date and/or opens the calendar in one of the available modes

void showDate(Date date,string mode);

Parameters

dateDatethe date that should be shown in the calendar
modestringoptional, the mode in which the calendar will be opened

Example

calendar.showDate(new Date(2020,11,12));

Related samples

Details

The modes are:

  • "calendar" - shows the days of a month, the default mode
  • "month" - allows selecting a month of a year
  • "year" - allows selecting a year
// shows the month of the specified date
calendar.showDate(new Date(2020,11,12),"month");
 
// shows the current month
calendar.showDate(null,"month");
 
// shows the current year together with previous/next years
calendar.showDate(new Date(2020,11,12),"year");
 
// shows the current year
calendar.showDate(null,"year");
See also
Back to top