summaryrefslogtreecommitdiffstats
path: root/toolkit/content
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-14 14:45:58 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-14 14:45:58 +0100
commit73c6f6b3deb95fff270898dfb3e48c116f714d5c (patch)
tree175c24964f6ccad4e1649171062d41ca7a3e0777 /toolkit/content
parent8a15fd8d24e4373f462046b46fbe8558f57f3403 (diff)
downloadUXP-73c6f6b3deb95fff270898dfb3e48c116f714d5c.tar
UXP-73c6f6b3deb95fff270898dfb3e48c116f714d5c.tar.gz
UXP-73c6f6b3deb95fff270898dfb3e48c116f714d5c.tar.lz
UXP-73c6f6b3deb95fff270898dfb3e48c116f714d5c.tar.xz
UXP-73c6f6b3deb95fff270898dfb3e48c116f714d5c.zip
Bug 1320225: [DateTimeInput] Integration of input type=date input box with picker (part 2)
Diffstat (limited to 'toolkit/content')
-rw-r--r--toolkit/content/browser-content.js1
-rw-r--r--toolkit/content/widgets/datetimebox.xml18
2 files changed, 17 insertions, 2 deletions
diff --git a/toolkit/content/browser-content.js b/toolkit/content/browser-content.js
index 4ae798fbd..731b55185 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 677d3fc21..5859f80dd 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>