fixed regression where weekNumberCalculation as a function wouldn't work

This commit is contained in:
Adam Shaw
2014-01-27 23:45:09 -08:00
parent bbc5fd9853
commit 161a476980
+6 -5
View File
@@ -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);
}
};