After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765897 - Wrong weekdays shown for date
Wrong weekdays shown for date
Status: RESOLVED DUPLICATE of bug 678507
Product: gnome-shell
Classification: Core
Component: calendar
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 774426 781279 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-05-02 08:43 UTC by Thomas Bechtold
Modified: 2017-10-25 16:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example screenshot (32.90 KB, image/png)
2016-05-02 08:45 UTC, Thomas Bechtold
Details

Description Thomas Bechtold 2016-05-02 08:43:30 UTC
With 3.20.1-1 on openSUSE Tumbleweed, I get wrong weekdays for dates. I.e. today it's 2nd May 2016 which is a Monday and it's correct shown but in the row/column view it's in the sunday column.
Comment 1 Thomas Bechtold 2016-05-02 08:45:09 UTC
Created attachment 327136 [details]
example screenshot
Comment 2 Florian Müllner 2016-11-14 20:07:16 UTC
*** Bug 774426 has been marked as a duplicate of this bug. ***
Comment 3 Florian Müllner 2017-04-13 16:32:17 UTC
*** Bug 781279 has been marked as a duplicate of this bug. ***
Comment 4 Hyungwon Hwang 2017-04-30 01:48:49 UTC
This bug happens after the system timezone changed. The root cause is that spidermonkey does not detect the change of timezone. Even after the timezone changed, the object created by new date() is in the old timezone.

But the new Date().toLocaleFormat(..) function which is overridden in js/ui/environment.js:120 uses Glib, so it uses correct timezone.

The difference between them makes this bug.

Calling JS_ClearDateCaches(
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_ClearDateCaches) could be a solution according to the documents. But as I tested in GJS console, it does not work well even though I modified to calling this function every time JS statement is evaluated.

JS_ClearDateCaches is replaced by another function JS::ResetTimeZone. It is also saying that it is needed to be called when the system timezone changes.

  46 diff --git a/js/public/Date.h b/js/public/Date.h                                
  47 index 2324ad7..f9df967 100644                                                   
  48 --- a/js/public/Date.h                                                          
  49 +++ b/js/public/Date.h                                                          
  50 @@ -39,6 +39,22 @@ struct JSContext;                                            
  51                                                                                 
  52  namespace JS {                                                                 
  53                                                                                 
  54 +/**                                                                            
  55 + * Re-query the system to determine the current time zone adjustment from UTC, 
  56 + * including any component due to DST.  If the time zone has changed, this will
  57 + * cause all Date object non-UTC methods and formatting functions to produce   
  58 + * appropriately adjusted results.                                             
  59 + *                                                                             
  60 + * Left to its own devices, SpiderMonkey itself may occasionally call this     
  61 + * method to attempt to keep up with system time changes.  However, no         
  62 + * particular frequency of checking is guaranteed.  Embedders unable to accept 
  63 + * occasional inaccuracies should call this method in response to system time  
  64 + * changes, or immediately before operations requiring instantaneous           
  65 + * correctness, to guarantee correct behavior.                                 
  66 + */                                                                            
  67 +extern JS_PUBLIC_API(void)                                                     
  68 +ResetTimeZone(); 

So I think that we need to update Spidermonkey to the latest one and a mechanism to detect the system timezone.

Is there already one for detecting timezone change?
Comment 5 Hyungwon Hwang 2017-04-30 01:51:05 UTC
I forgot to write the way to reproduce it.

Reproduce:
1. Change the system timezone in control panel.
2. Navigate months in popup calendar.
Comment 6 Michael Natterer 2017-05-06 13:07:39 UTC
For fixing it within the broken session restart the shell: "Alt+F2 r"
Comment 7 Claudio Saavedra 2017-10-25 13:14:25 UTC
Still present in 3.22 (I know, one year old but what can you do with Debian).

When using Wayland, Alt+F2 r doesn't work.

Will anyone fix this?
Comment 8 Claudio Saavedra 2017-10-25 15:32:57 UTC
> The root cause is that spidermonkey does not detect the change of timezone.

The root cause is that why do you need the timezone at all? A Monday 1st of January is Monday 1st of January regardless of timezone.
Comment 9 Jeremy Bicha 2017-10-25 16:25:30 UTC
Thanks for taking the time to report this.
This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed in the code repository.

*** This bug has been marked as a duplicate of bug 678507 ***