Better handling of time grid preference value possibilities

This commit is contained in:
Nathan Gray 2016-01-13 00:24:19 +00:00
parent c4d56049ab
commit 66138ad402

View File

@ -3321,7 +3321,12 @@ app.classes.calendar = AppJS.extend(
* How big or small are the displayed time chunks? * How big or small are the displayed time chunks?
*/ */
granularity: function(state) { 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 ? return list.indexOf(state.view) >= 0 ?
0 : 0 :
parseInt(egw.preference('interval','calendar')) || 30; parseInt(egw.preference('interval','calendar')) || 30;