I have a DatePicker defined as shown below to allow entering a time as well as a date. If I modify the time and then open the dropdown calendar, the time reverts back to whatever it was.
For example, if I programmatically set the datetime to 1/1/2016 3:00 PM, then change the time to 4:00 PM, as soon as I display the calendar the time changes back to 3:00 PM.
$("#dte").igDatePicker({ placeHolder: "Select Date...", readOnly: false, dateInputFormat: "dateTime", dateDisplayFormat: "dateTime", focusOnDropDownOpen: true, mode: "editable", required: true, value: null, tabIndex: 20,
});
Hello,
I am unable to replicate this behavior utilizing the selectDate method to programmatically change the hour of the igDatePicker. I am attaching the sample I utilized for testing this behavior. Feel free to modify it if you feel it is not an accurate representation of what you are trying to achieve.
Are you binding to any events that could potentially be setting the value of the igDatePicker after expanding the calendar (dropDownListOpened, dropDownListOpening)?
I was able to duplicate the problem using the file you provided. I've attached a screenshot to show what I did.
1. I clicked the "change hour to 3:00 AM" button
2. I clicked on the date and change the 3 to a 4.
3. Do not do anything to change the focus from the igDatePicker. Immediately click the down arrow to display the calendar. The time changes back to 3 AM.
The problem doesn't occur if you click off of the igDatePicker field first, then click the down arrow for the calendar. Losing focus must cause the value to be saved somewhere, but if you don't change focus before clicking the down arrow the value reverts back.