Sunday is counted towards next week
Opened this issue · 6 comments
The add-on has been working great, until Sunday passed. As can be seen on the image, all days up to Saturday are counted towards the previous week. Curiously, Sunday is counted towards the current week.
If I'm not mistaken this is not a feature (for some people the week does starts on Sunday), since the week header correctly states the week as being 9/18-9/24
, and the current week as being 9/25-10/1
. Sunday, the 9/24
is missing from the previous week, and is counted erroneously towards the current one.
The tracking itself has been excellent, so I guess only the tallying has some sort of problem.
Have you ever changed the "When a New Day Begins" preference?
I haven't; it is still set to 0 (which I guess is the default).
I forgot the following info:
- OS: Ubuntu Linux
- Browser: Firefox 56.0
- Timezone: EEST/UTC+3 (don't know if this could have any effect)
I can reproduce both problems (week starting on Sunday; title not matching first day) simply by running the "testing new day" code.
Sunday being the first day of the week is expected behavior. (But I would not be opposed to this becoming a setting that could be changed, though it would add complexity.)
I am not able to reproduce the title being inaccurate here. Perhaps it is a time zone related bug? I am in the EST time zone in the USA.
The first day of the week does not need to be a user preference, it should simply be derived from the user's locale:
moment.locale('en-GB')
"en-gb"
moment().startOf('week').format('LLLL LT Z')
"Monday, 30 October 2017 00:00 00:00 +01:00"
moment.locale('en-US')
"en"
moment().startOf('week').format('LLLL LT Z')
"Sunday, October 29, 2017 12:00 AM 12:00 AM +02:00"
Ah, I didn't realize this was locale dependent. I suppose that would work then.