summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dom/webidl/HTMLInputElement.webidl3
-rw-r--r--toolkit/content/browser-content.js1
-rw-r--r--toolkit/content/widgets/datetimebox.xml18
-rw-r--r--toolkit/modules/DateTimePickerHelper.jsm5
4 files changed, 21 insertions, 6 deletions
diff --git a/dom/webidl/HTMLInputElement.webidl b/dom/webidl/HTMLInputElement.webidl
index d3d537f84c..99da49ca2d 100644
--- a/dom/webidl/HTMLInputElement.webidl
+++ b/dom/webidl/HTMLInputElement.webidl
@@ -238,6 +238,9 @@ partial interface HTMLInputElement {
dictionary DateTimeValue {
long hour;
long minute;
+ long year;
+ long month;
+ long day;
};
partial interface HTMLInputElement {
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);
}
},