[FIX] Calendar, use date culture info for shortDateTime and axis in week view

bzr revid: jke@openerp.com-20140311152938-qdmf9xre758ri222
This commit is contained in:
Kersten Jeremy 2014-03-11 16:29:38 +01:00
parent 3ceefde489
commit 8da3b9e4d4
1 changed files with 12 additions and 11 deletions

View File

@ -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,
});
},