diff options
| author | Christophe Matthieu <chm@odoo.com> | 2017-04-18 14:24:04 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2017-04-19 14:48:06 +0200 |
| commit | 69ae6e2912aaf6190d9856f04069d725ef5ad5a4 (patch) | |
| tree | 88b8a00bd5db483912ca6d0faee9e3241daa4914 /addons/web/static/src/js/fields/basic_fields.js | |
| parent | 7ff8aa73e17b281b3e2bc4c7275d020eab0204e7 (diff) | |
[FIX] web: use correct timezone for date fields
before this commit when toggling allday flag in calendar form view, it was
possible to have one day error.
The input datetime is wrong when the user don't use the datepicker widget
(insert date by keypress instead of click on datepicker)
sometimes, the value could be null (crash because try to clone false)
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 9f37240e0cc..85cd0382ac2 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -283,6 +283,14 @@ var FieldDate = InputField.extend({ //-------------------------------------------------------------------------- /** + * @override + * @private + */ + _doDebouncedAction: function () { + this.datewidget.change_datetime(); + }, + + /** * return the datepicker value * * @private @@ -311,6 +319,16 @@ var FieldDate = InputField.extend({ this.$input = this.datewidget.$input; }, + /** + * FieldDateTime overrides _formatValue to use the session timezone + * + * @override + * @private + * @param {Moment} value + */ + _formatValue: function (value) { + return field_utils.format.date(value, {timezone: true}); + }, }); var FieldDateTime = FieldDate.extend({ |
