getValue

returns the current value of the DateRange

object getValue(string format);
formatstringoptional, a date format
objectrange object with 'start' and 'end' properties that represent the currently selected date range

Example

webix.ui({
    view:"daterange",
    id:"daterange1"
});
// setting a value
$$("daterange1").setValue({start:new Date(2016,9,30), end:new Date(2016,10,2)}); 
 
// getting a value
$$("daterange1").getValue(); 
// -> {start: Sun Oct 30 2016 00:00:00 GMT+0300 (Russia Standard Time), 
// end: Wed Nov 02 2016 00:00:00 GMT+0300 (Russia Standard Time)}
 
$$("daterange1").getValue("%d %m %Y") -> {start: '30 10 2016', end: '02 11 2016'}

Details

The returned range object contains two properties:

  • start - {Date object} a Date object for the start date
  • end - {Date object} a Date object for the end date
See also
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.