setValue

sets value for a TimePicker

void setValue(Date|number|string|array value);

Parameters

valueDate|number|string|arraythe value to be set for a timepicker

Example

// set the value as a string
timepicker.setValue("00:39");
 
// set the value as a Date object
timepicker.setValue(new Date('January 10, 2019 17:54:00'));
 
// set the value as an array
timepicker.setValue([6,20,"AM"]);
 
// set the value as a number
timepicker.setValue(1559288966422);

Related samples

Details

The value of timepicker set as an array should have the following elements:

  • the hour value
  • the minutes value
  • the "AM/PM" identifier for 12-hour format as a string

The date set as a number is the number of milliseconds since January 1, 1970, 00:00:00 UTC returned by the getTime() method of the Date object.

See also
Back to top