SingleDateAndTimePicker
SingleDateAndTimePicker copied to clipboard
Set defaultDate sets incorrect time
Steps to reproduce:
- Build the dialog instance with these settings
.displayHours(true)
.displayMinutes(true)
.displayAmPm(false)
.defaultDate(/* a date with a time of 22:00 */)
Expected: dialog shows with time set as 22:00 Actual: dialog shows with time set as 10:00
I think it could be fixed be reversing the order to setIsAmPm first in SingleDateAndTimePickerDialog:
if (defaultDate != null) {
picker.setDefaultDate(defaultDate);
}
if (isAmPm != null) {
picker.setIsAmPm(isAmPm);
}