summaryrefslogtreecommitdiffstats
path: root/models/users.js
diff options
context:
space:
mode:
authorMarc Hartmayer <hello@hartmayer.com>2020-04-22 21:04:44 +0200
committerMarc Hartmayer <hello@hartmayer.com>2020-04-23 10:40:53 +0200
commit405f176bbb04a02e9aa9be662df6412100ffb257 (patch)
treecf8f8365c775fbda1e0034543cf566bbb0796952 /models/users.js
parent4550e10fbeead146b5742820bd53b6846772c5f6 (diff)
downloadwekan-405f176bbb04a02e9aa9be662df6412100ffb257.tar.gz
wekan-405f176bbb04a02e9aa9be662df6412100ffb257.tar.bz2
wekan-405f176bbb04a02e9aa9be662df6412100ffb257.zip
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.
Diffstat (limited to 'models/users.js')
-rw-r--r--models/users.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/users.js b/models/users.js
index f4f4f38e..ebb14f5f 100644
--- a/models/users.js
+++ b/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() {