SingleDateAndTimePicker icon indicating copy to clipboard operation
SingleDateAndTimePicker copied to clipboard

Set defaultDate sets incorrect time

Open CarsonRedeye opened this issue 5 years ago • 1 comments

Steps to reproduce:

  1. 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

CarsonRedeye avatar Mar 07 '19 07:03 CarsonRedeye

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);
        }

CarsonRedeye avatar Mar 07 '19 07:03 CarsonRedeye