Bug 1147770 - Modify datapicker to support literal 'T' and 'Z' when choosing datetime. r=wesj

--HG--
extra : rebase_source : 2e13e4489b5c6b7dae4374740f417608afdd2055
This commit is contained in:
Mantaroh Yoshinaga 2015-04-30 19:29:00 -04:00
Родитель 994c1415bd
Коммит 2f38e0cc6f
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -216,7 +216,7 @@ public class PromptInput {
input.setCurrentMinute(calendar.get(GregorianCalendar.MINUTE));
mView = (View)input;
} else if (mType.equals("datetime-local") || mType.equals("datetime")) {
DateTimePicker input = new DateTimePicker(context, "yyyy-MM-dd HH:mm", mValue.replace("T"," "),
DateTimePicker input = new DateTimePicker(context, "yyyy-MM-dd HH:mm", mValue.replace("T"," ").replace("Z", ""),
DateTimePicker.PickersState.DATETIME);
input.toggleCalendar(true);
mView = (View)input;
@ -259,7 +259,7 @@ public class PromptInput {
} else if (mType.equals("datetime")) {
calendar.set(GregorianCalendar.ZONE_OFFSET,0);
calendar.setTimeInMillis(dp.getTimeInMillis());
return formatDateString("yyyy-MM-dd HH:mm",calendar);
return formatDateString("yyyy-MM-dd'T'HH:mm'Z'",calendar);
} else if (mType.equals("month")) {
return formatDateString("yyyy-MM",calendar);
}