Блог пользователя pratikpjain.15

Автор pratikpjain.15, история, 13 месяцев назад, По-английски

Hello Community,

As we can see in the image below, whenever you hover on the time section for a post or comment on codeforces, it shows you a wrong time. (I tried it for other posts and comments but same results) Not sure whether this is bug or intended, so just posting it out here.

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

»
13 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It is working fine if you are not logged in!

»
13 месяцев назад, # |
Rev. 7   Проголосовать: нравится +10 Проголосовать: не нравится

Yes this is also a time bug as well!

Time in 'My submissions' page
Time in 'Last submissions' tab as well as 'Submission' page
  • Sorry I have a problem putting all of this images into spoiler parts
»
9 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Its still unresolved!

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I had raised this concern 6 months ago and its still unresolved!!

»
6 месяцев назад, # |
Rev. 2   Проголосовать: нравится +15 Проголосовать: не нравится

I did some testing with switching my computer's time zones, and the results are really weird:

UTC-9:30 logged in
UTC-9:30 logged out
UTC-6:00 logged in
UTC+2:00 logged in
UTC+2:00 logged out
UTC+5:30 logged in
UTC+5:45 logged in
UTC+6:30 logged in
UTC+9:00 logged in

Not only does the bug only seem to happen when logged in and timezone is UTC+??:30, the formatting on the time is really weird (14.05.2003 vs Jul/14/2023, UTC+5.5 vs UTC+5:45) and the "correct" times still very much disagree with each other:

  • Jul/14/2023 06:38 UTC-9:30 = Jul/14/2023 16:08 UTC
  • Jul/14/2023 01:08 UTC-6:00 = Jul/14/2023 07:08 UTC
  • Jul/14/2023 17:08 UTC+2:00 = Jul/14/2023 15:08 UTC
  • Jul/14/2023 18:08 UTC+2:00 = Jul/14/2023 16:08 UTC
  • Jul/15/2023 00:38 UTC+5:45 = Jul/14/2023 18:53 UTC
  • Jul/15/2023 07:08 UTC+9:00 = Jul/14/2023 22:08 UTC

MikeMirzayanov

»
6 месяцев назад, # |
  Проголосовать: нравится +29 Проголосовать: не нравится

I went through the JS files out of curiosity and i think the issue is arising because of not using strict mode while parsing moment.
Changing var m = moment(dateString, ruTime + " Z"); to var m = moment(dateString, ruTime + " Z",true); in codeforces.js?v=20160131 fixed it locally for me.
Of course i don't have the complete picture so i might be wrong but i thought i should share it anyways.Hope it helps
MikeMirzayanov