Bug 187116

Summary: Holidays > 1 day show as multiple holidays.
Product: [Applications] korganizer Reporter: ned <naught101>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: aspotashev, gjditchfield, jlayt, smartins
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description ned 2009-03-14 09:23:05 UTC
Version:           1.4.1 (using Devel)
OS:                Linux
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.
Comment 1 John Layt 2010-05-29 02:17:52 UTC
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.
Comment 2 John Layt 2010-09-16 22:09:28 UTC
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.

New API:
  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,
                                       Holiday::MultidayHolidaysAsSingleEvents)

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.

CCBUG: 187116



 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
Comment 3 John Layt 2010-09-16 22:22:38 UTC
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.
Comment 4 Sergio Martins 2011-07-06 23:48:58 UTC
john, give me an example of a 2 day holiday please.
Comment 5 ned 2011-07-07 00:54:54 UTC
Ramadan. School holidays. Easter. My birthday.
Comment 6 John Layt 2011-07-16 20:18:16 UTC
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.
Comment 7 gjditchfield 2021-03-25 15:15:29 UTC
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.
Comment 8 gjditchfield 2021-08-30 03:25:50 UTC
I'm reporting the Lunar New Year problem as new bug 441738, and demoting the remaining display problem to the wiaslist.
Comment 9 Bug Janitor Service 2021-09-10 02:19:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/eventviews/-/merge_requests/41
Comment 10 gjditchfield 2021-09-11 00:43:57 UTC
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

https://invent.kde.org/pim/eventviews/commit/aabf184f8500ba0b8b0b1d220a5875715dfb1e3e