瀏覽代碼

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 年之前
父節點
當前提交
153d729544
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      models/users.js

+ 5 - 2
models/users.js

@@ -530,8 +530,11 @@ Users.helpers({
 
 
   getStartDayOfWeek() {
   getStartDayOfWeek() {
     const profile = this.profile || {};
     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() {
   getTemplatesBoardId() {