[plasmashell] [Bug 390330] Calendar top column does not contain all the days. Only Sat, Sun

2019-01-03 Thread Chris Holland
https://bugs.kde.org/show_bug.cgi?id=390330

--- Comment #8 from Chris Holland  ---
Git commit e5949866bb8f019a416930e2eb58bea363ff0ebf by Chris Holland.
Committed on 03/01/2019 at 21:58.
Pushed by cholland into branch 'master'.

[Calendar] Expose firstDayOfWeek in MonthView

This allows for calendar widgets to override the Locale. Users may
want to start the week on a Sunday, Saturday, or Monday without
changing their locale's date formatting.

Differential Revision: https://phabricator.kde.org/D15321

M  +1-0src/declarativeimports/calendar/qml/MonthView.qml

https://commits.kde.org/plasma-framework/e5949866bb8f019a416930e2eb58bea363ff0ebf

-- 
You are receiving this mail because:
You are watching all bug changes.

[plasmashell] [Bug 390330] Calendar top column does not contain all the days. Only Sat, Sun

2018-09-06 Thread Kai Uwe Broulik
https://bugs.kde.org/show_bug.cgi?id=390330

Kai Uwe Broulik  changed:

   What|Removed |Added

  Latest Commit||https://commits.kde.org/pla
   ||sma-framework/020d3e3ebea59
   ||5fc04642b5ec8f073f5a9478475
 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED

--- Comment #7 from Kai Uwe Broulik  ---
Git commit 020d3e3ebea595fc04642b5ec8f073f5a9478475 by Kai Uwe Broulik.
Committed on 06/09/2018 at 10:41.
Pushed by broulik into branch 'master'.

[Calendar] Wrap day name index around

Otherwise when the week starts on a day other than Sunday or Monday we access
invalid day names.

CHANGELOG: Fixed week names not showing properly in calendar when week starts
with a day other than Monday or Sunday

Differential Revision: https://phabricator.kde.org/D15309

M  +1-1src/declarativeimports/calendar/qml/DaysCalendar.qml

https://commits.kde.org/plasma-framework/020d3e3ebea595fc04642b5ec8f073f5a9478475

-- 
You are receiving this mail because:
You are watching all bug changes.

[plasmashell] [Bug 390330] Calendar top column does not contain all the days. Only Sat, Sun

2018-09-06 Thread Chris Holland
https://bugs.kde.org/show_bug.cgi?id=390330

--- Comment #6 from Chris Holland  ---
You're missing the second opening parentheses in `dayName((calendarBackend`.

Qt.locale(Qt.locale().uiLanguages[0]).dayName((calendarBackend.firstDayOfWeek +
index) % 7, Locale.ShortFormat)

--

Ah, yes, I can confirm that the following locale reproduces the bug.

LC_TIME="ar_EG.UTF-8" plasmoidviewer -a org.kde.plasma.digitalclock

I recently added a "first day of the week" option to Event Calendar, I'll look
into patching the digitalclock and calendar widgets.

-- 
You are receiving this mail because:
You are watching all bug changes.

[plasmashell] [Bug 390330] Calendar top column does not contain all the days. Only Sat, Sun

2018-09-06 Thread Ahmad El-Gazzaz
https://bugs.kde.org/show_bug.cgi?id=390330

--- Comment #5 from Ahmad El-Gazzaz  ---
(In reply to Chris Holland from comment #3)
> You should be able to modify this locally, then restart plasmashell, or wait
> for a patch.
> /usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/calendar/DaysCalendar.qml


I tried to edit the file as you suggested the widgets failed.
The line I changed was 315. The commented line is the original and the one I
edit is below
// text:
Qt.locale(Qt.locale().uiLanguages[0]).dayName(calendarBackend.firstDayOfWeek +
index, Locale.ShortFormat)
text:
Qt.locale(Qt.locale().uiLanguages[0]).dayName(calendarBackend.firstDayOfWeek +
index) % 7, Locale.ShortFormat)

And this is the result I got from the widgets.


Error loading QML file:
file:///usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/contents/ui/main.qml:54:34:
Type CalendarView unavailable
file:///usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/contents/ui/CalendarView.qml:352:9:
Type PlasmaCalendar.MonthView unavailable
file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/calendar/MonthView.qml:222:22:
Type DaysCalendar unavailable
file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/calendar/DaysCalendar.qml:316:132:
Expected token `,'


__

(In reply to Chris Holland from comment #4)
> I don't think *any* Locale uses a first day of the week other than Sunday or
> Monday, which is why this bug is only noticed when we hardcode the QML.

Just change the locale to Egypt [مصر - العربية (ar_EG)] and many countries in
the region and the start of the week will be Saturday.

Changing the local from systemsettings will results in too many changes across
KDE that I do not want. Since I can no longer change every minor detail in the
Regional settings I had to edit files directly to achieve what I want.

https://postimg.cc/image/6h3dl5pm9/

-- 
You are receiving this mail because:
You are watching all bug changes.

[plasmashell] [Bug 390330] Calendar top column does not contain all the days. Only Sat, Sun

2018-09-05 Thread Chris Holland
https://bugs.kde.org/show_bug.cgi?id=390330

--- Comment #4 from Chris Holland  ---
Ooooh, now I get why values of Sunday=0, and Monday=1 work, but Saturday=6 does
not.

The first screenshot show Satuday=6 and Sunday=7 fine since Qt converts
Sunday=0 to 7 anyways.

(Links to Qt code if you're bored, skip otherwise)
https://github.com/qt/qtdeclarative/blob/5.11/src/qml/qml/qqmllocale.cpp#L608
https://github.com/qt/qtbase/blob/5.11/src/corelib/tools/qlocale.cpp#L2517

By default the firstDayOfWeek is Sunday=0 for me (en_CA), but if we change it
to (sv_SE) where firstDayOfWeek is Monday=1, it still shows up fine (with
Sunday=7).

plasmoidviewer -a org.kde.plasma.calendar
LC_TIME="sv_SE.UTF-8" plasmoidviewer -a org.kde.plasma.calendar

I don't think *any* Locale uses a first day of the week other than Sunday or
Monday, which is why this bug is only noticed when we hardcode the QML.

-- 
You are receiving this mail because:
You are watching all bug changes.

[plasmashell] [Bug 390330] Calendar top column does not contain all the days. Only Sat, Sun

2018-09-05 Thread Chris Holland
https://bugs.kde.org/show_bug.cgi?id=390330

Chris Holland  changed:

   What|Removed |Added

 CC||zrenf...@gmail.com

--- Comment #3 from Chris Holland  ---
This is because DaysCalendar.qml uses:
https://github.com/KDE/plasma-framework/blob/8497832a8bf088a9011052841a50863ab40bf062/src/declarativeimports/calendar/qml/DaysCalendar.qml#L315

Assumes firstDayOfWeek is 0 (aka Sunday). Using firstDayOfWeek=6 (Saturday)
breaks this logic.

text:
Qt.locale(Qt.locale().uiLanguages[0]).dayName(calendarBackend.firstDayOfWeek +
index, Locale.ShortFormat)

instead of:
calendarBackend.firstDayOfWeek + index
we need to use:
(calendarBackend.firstDayOfWeek + index) % 7

I'm assuming the number of days in a week doesn't change (7), though I'm not
sure if there's a variable we can use to substitute.
http://doc.qt.io/qt-5/qml-qtqml-locale.html#weekDays-prop

You should be able to modify this locally, then restart plasmashell, or wait
for a patch.
/usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/calendar/DaysCalendar.qml

I'm not sure if locales that start on Saturday or Monday also experience this.
Gonna check.

-- 
You are receiving this mail because:
You are watching all bug changes.

[plasmashell] [Bug 390330] Calendar top column does not contain all the days. Only Sat, Sun

2018-02-28 Thread Christoph Feck
https://bugs.kde.org/show_bug.cgi?id=390330

Christoph Feck  changed:

   What|Removed |Added

  Component|Digital Clock   |Calendar

-- 
You are receiving this mail because:
You are watching all bug changes.

[plasmashell] [Bug 390330] Calendar top column does not contain all the days. Only Sat, Sun

2018-02-13 Thread Ahmad El-Gazzaz
https://bugs.kde.org/show_bug.cgi?id=390330

--- Comment #2 from Ahmad El-Gazzaz  ---
I edited the file: /usr/lib64/qt5/qml/org/kde/plasma/calendar/MonthView.qml

The commented line is the Original and the one I edited is below it.

Calendar {
id: calendarBackend

days: 7
weeks: 6
//firstDayOfWeek: Qt.locale().firstDayOfWeek
firstDayOfWeek: 6
today: root.today

Component.onCompleted: {
daysModel.setPluginsManager(EventPluginsManager);
}

onYearChanged: {
updateYearOverview()
updateDecadeOverview()
}
}

-- 
You are receiving this mail because:
You are watching all bug changes.

[plasmashell] [Bug 390330] Calendar top column does not contain all the days. Only Sat, Sun

2018-02-13 Thread Kai Uwe Broulik
https://bugs.kde.org/show_bug.cgi?id=390330

Kai Uwe Broulik  changed:

   What|Removed |Added

 CC||k...@privat.broulik.de

--- Comment #1 from Kai Uwe Broulik  ---
> I changed the start of the week to Saturday

Can you explain to me how you did that so I can reproduce your problem? I bet
it's just not wrapping the days properly, ie. it starts with 6 for Saturday,
goes to 7 for Sunday, and then fails to wrap around and uses 8 which it
obviously doesn't know.

-- 
You are receiving this mail because:
You are watching all bug changes.