diff --git a/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java b/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java index 9004179f007f..7fe2347addbd 100644 --- a/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java +++ b/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java @@ -178,7 +178,6 @@ public abstract class PromptInput { "week", "time", "datetime-local", - "datetime", "month" }; @@ -241,7 +240,7 @@ public abstract class PromptInput { input.setCurrentHour(calendar.get(GregorianCalendar.HOUR_OF_DAY)); input.setCurrentMinute(calendar.get(GregorianCalendar.MINUTE)); mView = (View)input; - } else if (mType.equals("datetime-local") || mType.equals("datetime")) { + } else if (mType.equals("datetime-local")) { DateTimePicker input = new DateTimePicker(context, "yyyy-MM-dd'T'HH:mm:ss", formatDateTimeSeconds(mValue), mSecondEnabled ? DateTimePicker.PickersState.DATETIME_WITH_SECOND : DateTimePicker.PickersState.DATETIME, @@ -267,9 +266,6 @@ public abstract class PromptInput { // Reformat the datetime value so that it can be parsed by // SimpleDateFormat ending with "HH:mm:ss". - // datetime may contain a 'Z' at the end. - dateString = dateString.replace("Z", ""); - int i = dateString.indexOf(":"); // Separator in "HH:mm". if (i == -1) { // Unparseable input. @@ -319,10 +315,6 @@ public abstract class PromptInput { return formatDateString("yyyy-MM-dd'T'HH:mm:ss", calendar); } return formatDateString("yyyy-MM-dd'T'HH:mm", calendar); - } else if (mType.equals("datetime")) { - calendar.set(GregorianCalendar.ZONE_OFFSET, 0); - calendar.setTimeInMillis(dp.getTimeInMillis()); - return formatDateString("yyyy-MM-dd'T'HH:mm'Z'", calendar); } else if (mType.equals("month")) { return formatDateString("yyyy-MM", calendar); } diff --git a/mobile/android/locales/en-US/chrome/browser.properties b/mobile/android/locales/en-US/chrome/browser.properties index 4a354aa5a3ee..5921c94e8e2e 100644 --- a/mobile/android/locales/en-US/chrome/browser.properties +++ b/mobile/android/locales/en-US/chrome/browser.properties @@ -344,7 +344,6 @@ selectHelper.closeMultipleSelectDialog=Done #Input widgets UI inputWidgetHelper.date=Pick a date -inputWidgetHelper.datetime=Pick a date and a time inputWidgetHelper.datetime-local=Pick a date and a time inputWidgetHelper.time=Pick a time inputWidgetHelper.week=Pick a week diff --git a/mobile/android/modules/InputWidgetHelper.jsm b/mobile/android/modules/InputWidgetHelper.jsm index b8d6a39d4167..17204528450c 100644 --- a/mobile/android/modules/InputWidgetHelper.jsm +++ b/mobile/android/modules/InputWidgetHelper.jsm @@ -39,10 +39,10 @@ var InputWidgetHelper = { }, show: function(aElement) { - let type = aElement.getAttribute("type"); + let type = aElement.type; new Prompt({ window: aElement.ownerGlobal, - title: this.strings().GetStringFromName("inputWidgetHelper." + aElement.getAttribute("type")), + title: this.strings().GetStringFromName("inputWidgetHelper." + type), buttons: [ this.strings().GetStringFromName("inputWidgetHelper.set"), this.strings().GetStringFromName("inputWidgetHelper.clear"), @@ -85,8 +85,8 @@ var InputWidgetHelper = { if (!(aElement instanceof win.HTMLInputElement)) return false; - let type = aElement.getAttribute("type"); - if (type == "date" || type == "datetime" || type == "datetime-local" || + let type = aElement.type; + if (type == "date" || type == "datetime-local" || type == "week" || type == "month" || type == "time") { return true; }