Browse Source

Fix getStartDayOfWeek function

In case profile.startDayOfWeek is 0 it's evaluated to false and 1 is returned.
Let's fix this by differentiating between undefined and an actual value.

Fixes: 9ae20a3f51e63c29f536e2f5b3e66a2c7d88c691
Marc Hartmayer 5 years ago
parent
commit
153d729544
1 changed files with 5 additions and 2 deletions
  1. 5 2
      models/users.js

+ 5 - 2
models/users.js

@@ -530,8 +530,11 @@ Users.helpers({
 
   getStartDayOfWeek() {
     const profile = this.profile || {};
-    // default is 'Monday' (1)
-    return profile.startDayOfWeek || 1;
+    if (typeof profile.startDayOfWeek === 'undefined') {
+      // default is 'Monday' (1)
+      return 1;
+    }
+    return profile.startDayOfWeek;
   },
 
   getTemplatesBoardId() {