diff options
author | Marc Hartmayer <hello@hartmayer.com> | 2020-04-28 20:50:55 +0200 |
---|---|---|
committer | Marc Hartmayer <hello@hartmayer.com> | 2020-04-28 20:56:11 +0200 |
commit | 153d729544fb5bbfa5fa40d236303cbc01352334 (patch) | |
tree | d8a9bb4262152643875fe59d647e58337a3dab9a /models/users.js | |
parent | 3d5abd60ccf3e0884a0346ec4a559ff5aa484b51 (diff) | |
download | wekan-153d729544fb5bbfa5fa40d236303cbc01352334.tar.gz wekan-153d729544fb5bbfa5fa40d236303cbc01352334.tar.bz2 wekan-153d729544fb5bbfa5fa40d236303cbc01352334.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.
Fixes: 9ae20a3f51e63c29f536e2f5b3e66a2c7d88c691
Diffstat (limited to 'models/users.js')
-rw-r--r-- | models/users.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/models/users.js b/models/users.js index 2d84141c..a1bc5b0f 100644 --- a/models/users.js +++ b/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() { |