diff --git a/src/Calendar.js b/src/Calendar.js index b7f77e2..b9a7dac 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -146,15 +146,16 @@ function Calendar(element, instanceOptions) { // `weekNumberCalculation` setting. t.calculateWeekNumber = function(mom) { var calc = options.weekNumberCalculation; - if (calc == 'local') { + + if (typeof calc === 'function') { + return calc(mom); + } + else if (calc === 'local') { return mom.week(); } - else if (calc.toUpperCase() == 'ISO') { + else if (calc.toUpperCase() === 'ISO') { return mom.isoWeek(); } - else if (typeof calc === 'function') { - return calc(mom); - } };