From 8da3b9e4d4f0b7cf430772a6484f2c1c25324ccb Mon Sep 17 00:00:00 2001 From: Kersten Jeremy Date: Tue, 11 Mar 2014 16:29:38 +0100 Subject: [PATCH] [FIX] Calendar, use date culture info for shortDateTime and axis in week view bzr revid: jke@openerp.com-20140311152938-qdmf9xre758ri222 --- .../static/src/js/web_calendar.js | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/addons/web_calendar/static/src/js/web_calendar.js b/addons/web_calendar/static/src/js/web_calendar.js index dce94604164..1041a2a9c24 100644 --- a/addons/web_calendar/static/src/js/web_calendar.js +++ b/addons/web_calendar/static/src/js/web_calendar.js @@ -21,6 +21,7 @@ openerp.web_calendar = function(instance) { } function get_fc_defaultOptions() { + shortTimeformat = Date.CultureInfo.formatPatterns.shortTime; return { weekNumberTitle: _t("W"), allDayText: _t("all-day"), @@ -29,7 +30,17 @@ openerp.web_calendar = function(instance) { dayNames: Date.CultureInfo.dayNames, dayNamesShort: Date.CultureInfo.abbreviatedDayNames, firstDay: Date.CultureInfo.firstDayOfWeek, - weekNumbers: true + weekNumbers: true, + axisFormat : shortTimeformat.replace(/:mm/,'(:mm)'), + timeFormat : { + // for agendaWeek and agendaDay + agenda: shortTimeformat + '{ - ' + shortTimeformat + '}', // 5:00 - 6:30 + // for all other views + '': shortTimeformat.replace(/:mm/,'(:mm)') // 7pm + }, + weekMode : 'liquid', + aspectRatio: 1.8, + snapMinutes: 15, }; } @@ -258,17 +269,7 @@ openerp.web_calendar = function(instance) { unselectAuto: false, - // Options - timeFormat : { - // for agendaWeek and agendaDay - agenda: 'h:mm{ - h:mm}', // 5:00 - 6:30 - // for all other views - '': 'h(:mm)tt' // 7pm - }, - weekMode : 'liquid', - aspectRatio: 1.8, - snapMinutes: 15, }); },