From 5dd738e2f5cde81b504024367bb656830ef3215c Mon Sep 17 00:00:00 2001 From: "Vaibhav (OpenERP)" Date: Tue, 18 Oct 2011 17:23:16 +0530 Subject: [PATCH] [FIX] Checked value with Date format re. bzr revid: vda@tinyerp.com-20111018115316-he9fdqs3d72avpgv --- addons/web_calendar/static/src/js/calendar.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 6d6ec3b8475..dcc9edf5644 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -180,13 +180,8 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ } } - if (this.fields[this.date_start]['type'] == 'date') { - try { - evt[this.date_start] = openerp.web.str_to_date(evt[this.date_start]).set({hour: 9}).toString('yyyy-MM-dd HH:mm:ss'); - } catch(e) {} - try { - evt[this.date_start] = openerp.web.str_to_datetime(evt[this.date_start]).set({hour: 9}).toString('yyyy-MM-dd HH:mm:ss'); - } catch(e) {} + if (this.fields[this.date_start]['type'] == 'date' && /^\d\d\d\d-\d\d-\d\d$/.exec(evt[this.date_start])) { + evt[this.date_start] = openerp.web.str_to_date(evt[this.date_start]).set({hour: 9}).toString('yyyy-MM-dd HH:mm:ss'); } if (this.date_stop && evt[this.date_stop] && this.fields[this.date_stop]['type'] == 'date') { evt[this.date_stop] = openerp.web.str_to_date(evt[this.date_stop]).set({hour: 17}).toString('yyyy-MM-dd HH:mm:ss');