I'm using the Kendo UI TimePicker control where the min and max times can be set to the next or previous day.
When selecting a time that exists the next (or previous) day the value returned is a full DateTime but is always set to the current date.
For example, if the current date time is "Jun 25, 2015 10:00 PM" and you scroll down and select "Jun 26, 2015 02:00 AM" the return value will be "Thu Jun 25 2015 02:00:00 GMT-0400 (Eastern Daylight Time)" but I'm expecting it to be June 26.
How do I make this control return the expected DateTime.
Here are my code segments:
// Init the control
$("#dtpEndDateTime").kendoTimePicker({
format: "MMM dd, yyyy hh:mm tt",
interval: 15,
change: onShiftEndDateTimeChange
});
// Set the values elsewhere
var dtpEndDateTime = $("#dtpEndDateTime").data("kendoTimePicker");
dtpEndDateTime.value(moment(_shift.EndDateTime).toDate());
dtpEndDateTime.min((moment(_shift.StartDateTime).add(15, "minutes")).toDate());
dtpEndDateTime.max((moment(_shift.EndDateTime).add(12, "hours")).toDate());
// get the selected value inside the onShiftEndDateTimeChange event
var datetimepicker = $("#dtpEndDateTime").data("kendoTimePicker");
console.log(datetimepicker.value());