Skip to main content

value

Optional. Selects the day (adds a round blue marker)

value?: Date | Date[] | string | string[];

Example

// selects a date
const calendar = new dhx.Calendar("calendar_container", {
value: new Date(2019,01,10)
});

// selects a date as an array of Date value
const calendar = new dhx.Calendar("calendar_container", {
value: [new Date(2019,01,10)]
});

// selects a date as a string
const calendar = new dhx.Calendar("calendar_container", {
value: ("10/02/19")
});

// selects a date as an array of string value
const calendar = new dhx.Calendar("calendar_container", {
value: (["10/02/19"])
});

// selects dates as an array of Date values(for the range mode)
const calendar = new dhx.Calendar("calendar_container", {
value: ([new Date(2019,05,03), new Date(2019,05,19)]),
range: true
});

// selects dates as an array of string values(for the range mode)
const calendar = new dhx.Calendar("calendar_container", {
value: (["03/06/19", "15/06/19"]),
range: true
});

Related sample: Calendar. Value initialization

If the property is not specified in the configuration object, nothing is selected in the calendar on initialization.

note

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 value and in the dateFormat property. Otherwise, the default format ("%d/%m/%y") will be used.