diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-02-14 14:45:58 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-02-14 14:45:58 +0100 |
commit | 73c6f6b3deb95fff270898dfb3e48c116f714d5c (patch) | |
tree | 175c24964f6ccad4e1649171062d41ca7a3e0777 /toolkit | |
parent | 8a15fd8d24e4373f462046b46fbe8558f57f3403 (diff) | |
download | uxp-73c6f6b3deb95fff270898dfb3e48c116f714d5c.tar.gz |
Bug 1320225: [DateTimeInput] Integration of input type=date input box with picker (part 2)
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/content/browser-content.js | 1 | ||||
-rw-r--r-- | toolkit/content/widgets/datetimebox.xml | 18 | ||||
-rw-r--r-- | toolkit/modules/DateTimePickerHelper.jsm | 5 |
3 files changed, 18 insertions, 6 deletions
diff --git a/toolkit/content/browser-content.js b/toolkit/content/browser-content.js index 4ae798fbdc..731b551857 100644 --- a/toolkit/content/browser-content.js +++ b/toolkit/content/browser-content.js @@ -1737,6 +1737,7 @@ let DateTimePickerListener = { } case "MozUpdateDateTimePicker": { let value = this._inputElement.getDateTimeInputBoxValue(); + value.type = this._inputElement.type; sendAsyncMessage("FormDateTime:UpdatePicker", { value }); break; } diff --git a/toolkit/content/widgets/datetimebox.xml b/toolkit/content/widgets/datetimebox.xml index 677d3fc21b..5859f80dd1 100644 --- a/toolkit/content/widgets/datetimebox.xml +++ b/toolkit/content/widgets/datetimebox.xml @@ -199,10 +199,24 @@ </method> <method name="setFieldsFromPicker"> + <parameter name="aValue"/> <body> <![CDATA[ - // TODO: Bug 1320225 - [DateTimeInput] Integration of input type=date - // input box with picker. + let year = aValue.year; + let month = aValue.month; + let day = aValue.day; + + if (!this.isEmpty(year)) { + this.setFieldValue(this.mYearField, year); + } + + if (!this.isEmpty(month)) { + this.setFieldValue(this.mMonthField, month); + } + + if (!this.isEmpty(day)) { + this.setFieldValue(this.mDayField, day); + } ]]> </body> </method> diff --git a/toolkit/modules/DateTimePickerHelper.jsm b/toolkit/modules/DateTimePickerHelper.jsm index 8ad5204f45..769ae0094c 100644 --- a/toolkit/modules/DateTimePickerHelper.jsm +++ b/toolkit/modules/DateTimePickerHelper.jsm @@ -97,13 +97,10 @@ this.DateTimePickerHelper = { // Called when picker value has changed, notify input box about it. updateInputBoxValue: function(aEvent) { - // TODO: parse data based on input type. - const { hour, minute } = aEvent.detail; - debug("hour: " + hour + ", minute: " + minute); let browser = this.weakBrowser ? this.weakBrowser.get() : null; if (browser) { browser.messageManager.sendAsyncMessage( - "FormDateTime:PickerValueChanged", { hour, minute }); + "FormDateTime:PickerValueChanged", aEvent.detail); } }, |