Commit 9ffc7c80 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Support Firefox non implementation of date input

parent b306c8f7
...@@ -96,10 +96,29 @@ ...@@ -96,10 +96,29 @@
.declareAcquiredMethod("notifyValid", "notifyValid") .declareAcquiredMethod("notifyValid", "notifyValid")
.declareMethod('checkValidity', function () { .declareMethod('checkValidity', function () {
var result = this.element.querySelector('input').checkValidity(); var result = this.element.querySelector('input').checkValidity(),
gadget = this;
if (result) { if (result) {
return this.notifyValid() return this.notifyValid()
.push(function () { .push(function () {
var date,
value;
if (!result) {
return result;
}
if ((gadget.state.type === 'date') ||
(gadget.state.type === 'datetime-local')) {
value = gadget.element.querySelector('input').value;
if (value) {
date = Date.parse(value);
if (isNaN(date)) {
return gadget.notifyInvalid("Invalid DateTime")
.push(function () {
return false;
});
}
}
}
return result; return result;
}); });
} }
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.35863.52273.29354</string> </value> <value> <string>954.45675.44850.53452</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1476697276.8</float> <float>1476869880.85</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment