From 66138ad4026b4a1b6c007fe8a7ce2359ce575c52 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 13 Jan 2016 00:24:19 +0000 Subject: [PATCH] Better handling of time grid preference value possibilities --- calendar/js/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/calendar/js/app.js b/calendar/js/app.js index bef38f4e26..8c2d14ce66 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -3321,7 +3321,12 @@ app.classes.calendar = AppJS.extend( * How big or small are the displayed time chunks? */ granularity: function(state) { - var list = egw.preference('use_time_grid','calendar').split(','); + var list = egw.preference('use_time_grid','calendar') || 'weekN'; + if(typeof list == 'string') list = string.split(','); + if(!list.indexOf && jQuery.isPlainObject(list)) + { + list = jQuery.map(list, function(el) { return el }); + } return list.indexOf(state.view) >= 0 ? 0 : parseInt(egw.preference('interval','calendar')) || 30;