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 669778 - Missing an option to hide weekday in clock.
Missing an option to hide weekday in clock.
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-09 22:04 UTC by Serhiy Zahoriya
Modified: 2017-09-11 18:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add gsettings option to hide weekday in clock (1.05 KB, application/x-gzip)
2012-02-09 22:09 UTC, Serhiy Zahoriya
  Details
Add a gsettings key to show/hide weekday (1.63 KB, patch)
2017-09-05 19:58 UTC, Cosimo Cecchi
none Details | Review
wall-clock: respect new clock-show-weekday setting (1.63 KB, patch)
2017-09-05 19:58 UTC, Cosimo Cecchi
none Details | Review
wall-clock: respect new clock-show-weekday setting (3.21 KB, patch)
2017-09-06 18:38 UTC, Cosimo Cecchi
committed Details | Review
build: bump gsettings-desktop-schemas requirement (737 bytes, patch)
2017-09-06 18:39 UTC, Cosimo Cecchi
accepted-commit_after_freeze Details | Review
Add a gsettings key to show/hide weekday (1.11 KB, patch)
2017-09-06 18:39 UTC, Cosimo Cecchi
committed Details | Review
build: bump version to 3.27.0 (788 bytes, patch)
2017-09-06 18:39 UTC, Cosimo Cecchi
committed Details | Review

Description Serhiy Zahoriya 2012-02-09 22:04:02 UTC
The weekday name is hardcoded in the dateMenu.js but I wanted to have an option to hide it. And with small edits I've made a new gsettings key and its' handling.
Adding a patch.

P.S. I'm not sure if my previous report was sent (I cannot find it anywhere), so I'll post a new one.
Comment 1 Serhiy Zahoriya 2012-02-09 22:06:50 UTC
P.P.S. Before patching dateMenu.js you need to add a new schema and recompile schemas with 

# /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
Comment 2 Serhiy Zahoriya 2012-02-09 22:09:07 UTC
Created attachment 207219 [details]
Patch to add gsettings option to hide weekday in clock
Comment 3 Serhiy Zahoriya 2012-02-09 22:14:04 UTC
And to set this option use 
$ gsettings set org.gnome.shell.clock show-weekday false
Comment 4 Allan Day 2012-10-03 10:10:46 UTC
Hi Сергій. I'm not sure why you want to hide this label. Can you give some more details? We generally don't allow customising the layout in this way, and this doesn't seem like a very useful option.
Comment 5 Serhiy Zahoriya 2012-10-03 10:30:24 UTC
Besides the fact that after installing many extensions the clock can end up hidden partially of fully behind "..." on a small netbook screen I just want an option to hide everything that I consider useless. At least for me and one my friend who asked me if I could hide it the weekday is not the information that should be displayed always.

I'm not sure why you don't allow customizing the layout in this way. Can you give some more details? Which way exactly? Was there a discussion about this?
Comment 6 Allan Day 2012-10-05 13:23:02 UTC
Ah right, I see. Seems reasonable to have a key for that. We have keys for changing the clock display in other ways, after all.
Comment 7 Florian Müllner 2012-10-16 23:12:14 UTC
(In reply to comment #2)
> Created an attachment (id=207219) [details]
> Patch to add gsettings option to hide weekday in clock

Patches should be attached in git's format-patch format (much easier to review!). The current version is not acceptable:

    clockFormat = showSeconds ? _((showWeekday ? "%a " : "")+"%b %e, %R:%S")
                              : _((showWeekday ? "%a " : "")+"%b %e, %R");

gettext doesn't handle string concatenation, so you are breaking localization. Assuming that the weekday is simply prepended to the format string in any language gnome-shell supports, you should do (at the end of the switch statement):

  if (showWeekday)
      clockFormat = "%a " + clockFormat;

But the assumption itself is wrong - running

  git grep -A1 'msgid "%A %B %e, %Y"' -- po

shows quite a few locales which add a comma after the weekday, and even a couple where the weekday is located at the end of the format string.

So to implement the option, there's no way around doubling the number of format strings - see the code gnome-shell uses nowadays for the clock[0]. The good news there is that it is already possible to hide the weekday, but it is not exposed in GSettings and tied to the date (e.g. it is not possible to hide the weekday and show the date).

So let's reassign this to gnome-desktop, which implements the functionality (the corresponding settings are part of gsettings-desktop-schemas).

[0] http://git.gnome.org/browse/gnome-desktop/tree/libgnome-desktop/gnome-wall-clock.c#n234
Comment 8 u2nGn 2015-04-18 01:58:35 UTC
This old bug still comes up No. 1 when searching for how to get rid of the day. Just tried the patches+recompiling the schemas and, though the option appears and can be set (in gnome 3 even!), it does not work.

So on to the desktop link: apparently some code has been added. See line 288 (at this writing), which declares: "gboolean    show_weekday"

However, no such option appears in the current framework and the day-of-week is still eating up valuable space -- and no way to make it disappear.
Comment 9 Florian Müllner 2015-04-18 08:30:43 UTC
(In reply to u2nGn from comment #8)
> This old bug still comes up No. 1 when searching for how to get rid of the
> day. Just tried the patches+recompiling the schemas and, though the option
> appears and can be set (in gnome 3 even!), it does not work.

See comment #7 - the functionality is no longer implemented in gnome-shell (which is what the patch changes) but in gnome-desktop.
Comment 10 Cosimo Cecchi 2017-09-05 19:58:01 UTC
Created attachment 359237 [details] [review]
Add a gsettings key to show/hide weekday
Comment 11 Cosimo Cecchi 2017-09-05 19:58:38 UTC
Created attachment 359238 [details] [review]
wall-clock: respect new clock-show-weekday setting
Comment 12 Cosimo Cecchi 2017-09-05 20:00:38 UTC
Since we have the same desire for the Endless shell (avoid showing the weekday), and right now we hardcode it, here are two patches that implement the requested functionality in an upstream-friendly way.
Thanks for considering.
Comment 13 Bastien Nocera 2017-09-06 08:40:11 UTC
Review of attachment 359237 [details] [review]:

::: configure.ac
@@ +1,2 @@
 AC_PREREQ(2.53)
+AC_INIT([gsettings-desktop-schemas], [3.27.0],

Can you please bump that separately? Say, after branching.
Comment 14 Bastien Nocera 2017-09-06 08:42:17 UTC
Review of attachment 359238 [details] [review]:

Could you please add a test for this in wall-clock? Verify the before and after changing the setting.
Comment 15 Cosimo Cecchi 2017-09-06 18:38:57 UTC
Created attachment 359302 [details] [review]
wall-clock: respect new clock-show-weekday setting
Comment 16 Cosimo Cecchi 2017-09-06 18:39:04 UTC
Created attachment 359303 [details] [review]
build: bump gsettings-desktop-schemas requirement

This is needed for the new schema.
Comment 17 Cosimo Cecchi 2017-09-06 18:39:22 UTC
Created attachment 359304 [details] [review]
Add a gsettings key to show/hide weekday
Comment 18 Cosimo Cecchi 2017-09-06 18:39:28 UTC
Created attachment 359305 [details] [review]
build: bump version to 3.27.0
Comment 19 Cosimo Cecchi 2017-09-06 18:41:13 UTC
Thanks Bastien. I added a test and separated the version bumps in their own commits.
Comment 20 Bastien Nocera 2017-09-11 17:19:56 UTC
Review of attachment 359302 [details] [review]:

Sure.
Comment 21 Bastien Nocera 2017-09-11 17:20:42 UTC
Review of attachment 359303 [details] [review]:

You can merge this into the previous patch, or you'll need to make sure to bump the requirement before the code change.
Comment 22 Bastien Nocera 2017-09-11 17:21:01 UTC
Review of attachment 359302 [details] [review]:

Should be commit after freeze, sorry.
Comment 23 Bastien Nocera 2017-09-11 17:21:22 UTC
Review of attachment 359304 [details] [review]:

Sure.
Comment 24 Bastien Nocera 2017-09-11 17:22:01 UTC
Review of attachment 359305 [details] [review]:

Don't forget to branch gnome-3-24
Comment 25 Cosimo Cecchi 2017-09-11 18:51:23 UTC
Attachment 359304 [details] pushed as 4a93810 - Add a gsettings key to show/hide weekday
Attachment 359305 [details] pushed as 64231fb - build: bump version to 3.27.0
Comment 26 Cosimo Cecchi 2017-09-11 18:56:34 UTC
Attachment 359302 [details] pushed as 84f55f5 - wall-clock: respect new clock-show-weekday setting

Branched gsettings-desktop-schemas and gnome-desktop, pushed these to master. Thanks!