This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to set Monday as the first day of calendar widget?

Tags: None
(comma "," separated)
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
Hi,

As the title says currently Sunday is set to be the first day of calendar widget. I would like it to be Monday. How do I do it?

Code: Select all
$ localectl status                                                                                                                               
   System Locale: LANG=en_IN.UTF-8                                                                                                                                     
       VC Keymap: us                                                                                                                                                   
      X11 Layout: us,in                                                                                                                                                 
     X11 Variant: ,eng


FWIW Korganizer automatically chooses Monday as the first day of the week while the widget doesn't?

Regards,
Sudhir.
User avatar
google01103
Manager
Posts
6668
Karma
25
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
KOrganizer has correctly chosen Monday as the first day of the week. The problem is with the plasma widget which still chooses Sunday as the first day of the week. I don't suppose they are related. I have observed as long as I set my locale LANG=en_IN.UTF-8 the calendar will automatically set to use Monday as the first day. Should I file another bug report so that the widget also chooses same settings as KOrganizer.

Code: Select all
$ locale -ck LC_TIME
LC_TIME
abday="Sun;Mon;Tue;Wed;Thu;Fri;Sat"
day="Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday"
abmon="Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec"
mon="January;February;March;April;May;June;July;August;September;October;November;December"
am_pm="AM;PM"
d_t_fmt="%A %d %B %Y %I:%M:%S %p %Z"
d_fmt="%A %d %B %Y"
t_fmt="%I:%M:%S  %Z"
t_fmt_ampm="%I:%M:%S %p %Z"
era=
era_year=""
era_d_fmt=""
alt_digits=
era_d_t_fmt=""
era_t_fmt=""
time-era-num-entries=0
time-era-entries="S"
week-ndays=7
week-1stday=19971130
week-1stweek=0
first_weekday=1
first_workday=2
cal_direction=1
timezone=""
date_fmt="%a %b %e %H:%M:%S %Z %Y"
time-codeset="UTF-8"
User avatar
google01103
Manager
Posts
6668
Karma
25
I would file


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
google01103 wrote:I would file


I filed the bug which got closed pretty quickly. Calendar follows locale settings. KOrganizer follows some other unknown settings. So I am back to square one.

https://bugs.kde.org/show_bug.cgi?id=360965
User avatar
google01103
Manager
Posts
6668
Karma
25
it is available in systemsettings for KDE 4 https://userbase.kde.org/File:Settings-locale.png if you're using 5 then I think it is a QT issue and would be this bug https://userbase.kde.org/File:Settings-locale.png


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
Rog131
Registered Member
Posts
828
Karma
10
Plasma 5 calendar widget and clock's calendar is reading the first day of the week from the Qt locales - The MonthView.qml has line:
Code: Select all
firstDayOfWeek: Qt.locale().firstDayOfWeek


With the Arch Linux & Plasma 5.6 the MonthView.qml is a the /usr/lib/qt/qml/org/kde/plasma/calendar/

By the http://doc.qt.io/qt-5/qml-qtqml-locale. ... fWeek-prop :

firstDayOfWeek : enumeration
Holds the first day of the week according to the current locale.

Locale.Sunday = 0
Locale.Monday = 1
Locale.Tuesday = 2
Locale.Wednesday = 3
Locale.Thursday = 4
Locale.Friday = 5
Locale.Saturday = 6


At here, changing the
Code: Select all
firstDayOfWeek: Qt.locale().firstDayOfWeek

to
Code: Select all
firstDayOfWeek: 1


this will set the Monday as the first day at the week.

Image
Full image: http://i.imgur.com/S9eOlJb.png
User avatar
google01103
Manager
Posts
6668
Karma
25
Rog131 great work

in openSUSE that file is /usr/lib64/qt5/qml/org/kde/plasma/calendar/MonthView.qml

Sudhir Khanger remember that file will be written over during a future upgrade

that "Qt.locale().firstDayOfWeek" isn't setable in systemsettings is imho a bug


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
google01103 wrote:Rog131 great work

in openSUSE that file is /usr/lib64/qt5/qml/org/kde/plasma/calendar/MonthView.qml

Sudhir Khanger remember that file will be written over during a future upgrade

that "Qt.locale().firstDayOfWeek" isn't setable in systemsettings is imho a bug


Thanks google01103,

I don't like to modify system files. That's in purview of the package manager especially not when it get over written easily.

But thanks for taking time to write it. I will save it for future and hopefully it will be fixed in Qt.
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
Thanks Rog131. That does work.
manukde
Registered Member
Posts
2
Karma
0
Thanks @Rog131, worked.
However the path was "/usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/calendar/MonthView.qml" for me.
aarhansharma
Registered Member
Posts
1
Karma
0
thanks for sharing the useful information :)


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar