Skip to content

Commit

Permalink
Fix Time picker issue
Browse files Browse the repository at this point in the history
This patch fixes the issue that the date picker instead of the time
picker is shown for <input type="time">.
  • Loading branch information
MyidShin authored and svillar committed Feb 16, 2024
1 parent 290eef6 commit 8877dc0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Context;
import android.icu.util.Calendar;
import android.text.format.DateFormat;
import android.view.View;
import android.widget.Button;

import android.widget.DatePicker;
Expand Down Expand Up @@ -104,6 +105,7 @@ protected void initialize(Context aContext) {
datePicker.setMaxDate(maxDate.getTime());
}
} else {
findViewById(R.id.date_picker).setVisibility(View.GONE);
datePicker = null;
}

Expand All @@ -114,6 +116,7 @@ protected void initialize(Context aContext) {
timePicker.setMinute(cal.get(java.util.Calendar.MINUTE));
timePicker.setIs24HourView(DateFormat.is24HourFormat(aContext));
} else {
findViewById(R.id.time_picker).setVisibility(View.GONE);
timePicker = null;
}

Expand Down

0 comments on commit 8877dc0

Please sign in to comment.