From 226e6bce83b5a0f1a20682f78d9f6da5444320dd Mon Sep 17 00:00:00 2001 From: Viras- Date: Wed, 20 Jan 2016 13:46:56 +0100 Subject: [PATCH] making sure manually entered times are recognized correctly --- src/android/DatePickerPlugin.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/android/DatePickerPlugin.java b/src/android/DatePickerPlugin.java index b76edcc..6009004 100644 --- a/src/android/DatePickerPlugin.java +++ b/src/android/DatePickerPlugin.java @@ -319,9 +319,12 @@ public void onTimeSet(final TimePicker view, final int hourOfDay, final int minu if (canceled) { return; } - - calendarDate.set(Calendar.HOUR_OF_DAY, hourOfDay); - calendarDate.set(Calendar.MINUTE, minute); + + // make sure all values are updated + view.clearFocus(); + + calendarDate.set(Calendar.HOUR_OF_DAY, view.getCurrentHour()); + calendarDate.set(Calendar.MINUTE, view.getCurrentMinute()); calendarDate.set(Calendar.SECOND, 0); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");