Detect correctly when to parse value from DateTime, Date or Time field

issue3957
review11301002
This commit is contained in:
Guillem Barba committed 2014-06-02 17:26:06 +02:00
1 parent 88d3db8e37
commit b8d779de06
1 file changed
+3 -3
+3 -3
View File
@@ -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,