2
0
Эх сурвалжийг харах

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.
Marc Hartmayer 5 жил өмнө
parent
commit
405f176bbb
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      models/users.js

+ 2 - 1
models/users.js

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