From b8d779de06f5dbb9e8f3ffe039fe47665875e181 Mon Sep 17 00:00:00 2001 From: Guillem Barba Date: Mon, 2 Jun 2014 17:26:06 +0200 Subject: [PATCH] Detect correctly when to parse value from DateTime, Date or Time field issue3957 review11301002 --- src/model.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/model.js b/src/model.js index bdcbf89d75..22501748d7 100644 --- a/src/model.js +++ b/src/model.js @@ -1190,7 +1190,7 @@ return record.expr_eval(this.description.format); }, set_client: function(record, value, force_change) { - if (!(value instanceof Date)) { + if (typeof value == 'string') { try { value = Sao.common.parse_datetime( Sao.common.date_format(), @@ -1216,7 +1216,7 @@ Sao.field.Date = Sao.class_(Sao.field.Field, { _default: null, set_client: function(record, value, force_change) { - if (!(value instanceof Date)) { + if (typeof value == 'string') { try { value = Sao.Date(jQuery.datepicker.parseDate( Sao.common.date_format(), value)); @@ -1243,7 +1243,7 @@ return record.expr_eval(this.description.format); }, set_client: function(record, value, force_change) { - if (!(value instanceof Sao.Time)) { + if (typeof value == 'string') { value = Sao.common.parse_time(this.time_format(record), value); } Sao.field.Time._super.set_client.call(this, record, value,