Version: 1.4.1 (using Devel)
Installed from: Compiled sources
Events that are longer than one day correctly display as a single wide object, with rounded ends.
Holidays with "length >1 days" (2 or more days) show up as multiple day-long holidays. They should show up as events do - as a single object.
KHolidays supports defining a holidays length in the holiday file, but doesn't expose this information to its clients. Instead it returns multiple holidays, one for each day in the length. I plan to fix this in KHolidays in SC 4.6.
SVN commit 1176150 by jlayt:
Add support for holiday duration.
The existing behaviour of KHolidays for multiday holidays is to return a
Holiday instance for every day the holiday occurs, but this prevents clients
from drawing a single object to cover all the days.
This change introduces a new mode where multiday holidays can be returned as a
single Holiday instance with a duration value for the number of days the
holiday lasts for.
For backwards compatability, by default multiple Holiday instances will be
still returned but with a duration of 1 day.
Holiday::MultidayMode enum to set the multiday handling mode
Holiday::duration() returns the holiday duration in days
Holiday::observedStartDate() returns the start date of the holiday
Holiday::observedEndDate() returns the end date of the holiday
HolidayRegion::holidays() versions to take the new MultidayMode enum
So an app will now call something like:
Holiday::List holidays = m_holidayRegion.holidays(startDate, endDate,
Note that the api is subject to revision in light of further enhancements,
and the new enum values might be a bit too long :-) Comments welcomed.
M +18 -3 holiday.cpp
M +30 -1 holiday.h
M +4 -2 holiday_p.h
M +21 -4 holidayregion.cpp
M +26 -0 holidayregion.h
M +9 -5 parsers/holidayparserdriver.cpp
M +10 -3 parsers/holidayparserdriver_p.h
M +1 -1 parsers/plan1/holidayparserdriverplanold.cpp
M +15 -9 parsers/plan2/holidayparserdriverplan.cpp
M +2 -0 parsers/plan2/holidayparserdriverplan_p.h
M +11 -8 tests/testholidayregion.cpp
M +7 -3 tests/testholidayregion.h
WebSVN link: http://websvn.kde.org/?view=rev&revision=1176150
OK, now KHolidays can tell the duration for each holiday if asked, I'm passing back to KOrganizer to make use of it :-) Let me know if you'd like the API changed in any way.
john, give me an example of a 2 day holiday please.
Ramadan. School holidays. Easter. My birthday.
Try the French holiday file which has Easter and Pentecost each 2 days long, or Hong Kong English which has Lunar New Years over 3 days, or Israel English which has 4 holidays lasting between 2 and 8 days.
With KOrganizer 5.16.3, and with the "Canada (English)", "France (French)", and "Hong Kong (English)" holidays selected
- The Agenda view shows Pâques on April 4--5 2021. The Month view shows it as separate rectangles on the 4th and 5th.
- The Agenda view shows Lunar New Year on February 12--15 2021. The Month view shows it as separate rectangles on the 12th, 13th, and 14th only. Perhaps an interaction with Valentine's Day is truncating it?
I'm raising the importance because of the Lunar New Year oddity.
I'm reporting the Lunar New Year problem as new bug 441738, and demoting the remaining display problem to the wiaslist.
A possibly relevant merge request was started @ https://invent.kde.org/pim/eventviews/-/merge_requests/41
Git commit aabf184f8500ba0b8b0b1d220a5875715dfb1e3e by Glen Ditchfield.
Committed on 10/09/2021 at 01:44.
Pushed by gditchfield into branch 'release/21.08'.
Display multi-day holidays as one wide block in the Month View
Display multi-day holidays, such as Lunar New Year in the Hong Kong
holiday list, just like a multi-day event: a block that spans days,
instead of separate blocks on each day.
As a side-effect, Valentine's Day does not appear in the Month View
when it happens to fall on a non-workday. The Month View will only
show true non-workday holidays.
Users of multiple regional calendars may see multiple holidays on a
day, instead of one block with multiple holiday names in it.
M +5 -0 src/month/autotests/monthitemordertest.cpp
M +7 -1 src/month/monthitem.cpp
M +5 -3 src/month/monthitem.h
M +18 -10 src/month/monthview.cpp
M +4 -0 src/month/monthview.h