getValue()
returns the selected date
getValue(asDatObj?: boolean): Date | Date[] | string | string[];
Parameters:
asDatObj: boolean
- defines whether a date will be returned as a Date object
Returns:
The selected date.
Example
const date = calendar.getValue(); // -> "03/06/19"
const date = calendar.getValue(true); // -> Fri Jan 11 2019 18:09:15 GMT+0300
// for a range calendar as an array of Date values
const date = calendar.getValue(true);
// -> [Mon Jun 03 2019 00:00:00 GMT+0300, Wed Jun 19 2019 00:00:00 GMT+0300]
// for a range calendar as an array of string values
const date = calendar.getValue(); // -> ["03/06/19", "19/06/19"]
Related sample: Calendar. Getting selected date