Bookmark reminder for next Monday is off by one day

Hi,

There is a small bug in the bookmarking feature. There is a options to set reminder for “Next Monday”, but its 18th of may, not 17th of may:

our discourse server hosted by discourse: https://keskustelut.inderes.fi/

4 curtidas

Mine says the 18th, so maybe it’s a time zone issue. Though in my case it’s still weird that “Next Monday” shows up before “Next Week” in the list since that’s out of order chronologically. (I assume this only happens on Sunday.)

3 curtidas

What timezone do you have set in your user preferences? Did “daylight savings time” happen recently in your timezone? cc @martin

2 curtidas

Im not sure where to check our timezone, but this is something i found what could be related to this?
We are located in Finland and our timezone is EEST (summer time) 3 hours ahead UTC.
Finland switches to EEST 28.3.2020 and in winters its +2 EET

1 curtida

Maybe this is something to do with different localizations starting their week on different days – I will take a look today.

7 curtidas

Well, I was close with the localization guess. The forum you linked has Finnish localization, and I did not realize that the moment.js .day() function is locale-dependent IF you give it a string to parse. I was giving it the string “Monday” (which in Finnish is “maanantai”), so the parse failed and moment.js fell back to Sunday.

I’ve changed this in the below PR to use the number 1 which is always Monday no matter the locale.

https://github.com/discourse/discourse/pull/9737

As an additional note, “Next Week” is just "today + 7 days so locale is not a factor there.

10 curtidas