Bug 828619 - Always update date time after changing 24hr mode. r=jchen

This commit is contained in:
Wes Johnston 2013-01-09 14:50:22 -08:00
parent 3a785a8c2d
commit da40e79b6b

View File

@ -160,14 +160,15 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
} else if (type.equals("time")) {
TimePicker input = new TimePicker(GeckoApp.mAppContext);
input.setIs24HourView(DateFormat.is24HourFormat(GeckoApp.mAppContext));
GregorianCalendar calendar = new GregorianCalendar();
if (!value.equals("")) {
try {
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(new SimpleDateFormat("kk:mm").parse(value));
input.setCurrentHour(calendar.get(GregorianCalendar.HOUR_OF_DAY));
input.setCurrentMinute(calendar.get(GregorianCalendar.MINUTE));
} catch (Exception e) { }
}
input.setCurrentHour(calendar.get(GregorianCalendar.HOUR_OF_DAY));
input.setCurrentMinute(calendar.get(GregorianCalendar.MINUTE));
view = (View)input;
} else if (type.equals("datetime-local") || type.equals("datetime")) {
DateTimePicker input = new DateTimePicker(GeckoApp.mAppContext, "yyyy-MM-dd kk:mm", value,