summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets/date_picker.js
diff options
context:
space:
mode:
authorJorge Pinna Puissant <jpp@odoo.com>2019-09-18 15:27:06 +0000
committerJorge Pinna Puissant <jpp@odoo.com>2019-09-19 07:07:03 +0000
commitf629cd9672cd22ef0e11ac839c1b500d62ab4e76 (patch)
tree0e59b1ef35e5e7390d7f019b47ac87d2e03202d6 /addons/web/static/src/js/widgets/date_picker.js
parentd786d7d250b9fb6dc46f8d4f790fb5975910f330 (diff)
[FIX] web: write date without separator
Since fbbfa6d it's not longer possible to write a date without separator (e.g., 0102 for 01/02/2019; 121298 for 12/12/1998; 02042018 for 02/04/2018), or a date without year (e.g., 01/02 for 01/02/2019) in the datepicker widget. In this commit we have decided to be as permissive as tempus dominus that call moment.js with strict false. This allows moment.js to deduct a date from a string in a more versatile way. This also allows a more versatile autocomplete in the search views. opw-2070464 opw-2070931 closes odoo/odoo#37095 Forward-port-of: odoo/odoo#36821 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/widgets/date_picker.js')
-rw-r--r--addons/web/static/src/js/widgets/date_picker.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/web/static/src/js/widgets/date_picker.js b/addons/web/static/src/js/widgets/date_picker.js
index 8eafd93ef93..6b995afde12 100644
--- a/addons/web/static/src/js/widgets/date_picker.js
+++ b/addons/web/static/src/js/widgets/date_picker.js
@@ -88,6 +88,13 @@ var DateWidget = Widget.extend({
* set datetime value
*/
changeDatetime: function () {
+ if (this.__libInput > 0) {
+ if (this.options.warn_future) {
+ this._warnFuture(this.getValue());
+ }
+ this.trigger("datetime_changed");
+ return;
+ }
var oldValue = this.getValue();
if (this.isValid()) {
this._setValueFromUi();