6.0.0-alpha12
6/8/25

[#3862] Add support for Date_Holidays
Summary Add support for Date_Holidays
Queue Kronolith
Queue Version HEAD
Type Enhancement
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester webmaster (at) dasourcerer (dot) net
Created 05/02/2006 (6977 days ago)
Due
Updated 05/01/2007 (6613 days ago)
Assigned 10/15/2006 (6811 days ago)
Resolved 05/01/2007 (6613 days ago)
Milestone
Patch No

History
05/01/2007 10:19:11 PM Jan Schneider Comment #18
State ⇒ Resolved
Reply to this comment
Yes, it works fine now as it is. Kind of.
04/30/2007 08:58:10 PM Chuck Hagenbuch Comment #17 Reply to this comment
Jan - can we close this ticket for now, and either re-open it or 
create new tickets if there are horde-specific date_holidays problems?
11/25/2006 11:20:37 AM webmaster (at) dasourcerer (dot) net Comment #15 Reply to this comment
Are you still tracking this down and submitting reports to the
package maintainers?
I'll do as soon as I find the time.
Yes, but the data_dir doesn't have to be inside the PEAR_INSTALL_DIR,
though it's the default location. But you can set it to any directory.
Yes... Ok... I kept that in mind. Unfortunately, there doesn't seem to 
be a PEAR_DATA_DIR define, so going down from PEAR_INSTALL_DIR was my 
best chance. If I find a better solution (or anything changes within 
Date_Holidays), I'll send in another patch. Promise.
11/25/2006 09:56:15 AM Jan Schneider Comment #14 Reply to this comment
There are still some issue, mostly limititations in Date_Holiday
probably. It's too odd that you have to find out yourself if a
translation exists and which one. This should be done inside the
package.
Oh yes, indeed. I had a lot of fun with that one :-/ It even seems
that once a non-existent driver is loaded, all others are flushed.
Very weird...
Are you still tracking this down and submitting reports to the package 
maintainers?
It's even broken at the moment because you are looking in a
hardcoded PEAR path for the data files, but we should really look at
PEAR's data_dir configuration variable.
Er... Are you sure? I'm pretty confident I used PEAR's
PEAR_INSTALL_DIR as path. Nevertheless I'm glab my patch made it into
CVS ;)
Yes, but the data_dir doesn't have to be inside the PEAR_INSTALL_DIR, 
though it's the default location. But you can set it to any directory.
11/25/2006 12:37:16 AM webmaster (at) dasourcerer (dot) net Comment #13 Reply to this comment
I removed the links to Wikipedia
because it seemed odd to link to a dictionary from a calendar, and I
had too many false results.
Ok, it just seemed to be a cool gadget. I had the idea when I 
overwrote the tooltip function.
There are still some issue, mostly limititations in Date_Holiday
probably. It's too odd that you have to find out yourself if a
translation exists and which one. This should be done inside the
package.
Oh yes, indeed. I had a lot of fun with that one :-/ It even seems 
that once a non-existent driver is loaded, all others are flushed. 
Very weird...
It's even broken at the moment because you are looking in a
hardcoded PEAR path for the data files, but we should really look at
PEAR's data_dir configuration variable.
Er... Are you sure? I'm pretty confident I used PEAR's 
PEAR_INSTALL_DIR as path. Nevertheless I'm glab my patch made it into 
CVS ;)
11/25/2006 12:13:15 AM Jan Schneider Comment #12
State ⇒ Feedback
Reply to this comment
Cleaned up and committed, thanks. I removed the links to Wikipedia 
because it seemed odd to link to a dictionary from a calendar, and I 
had too many false results.

There are still some issue, mostly limititations in Date_Holiday 
probably. It's too odd that you have to find out yourself if a 
translation exists and which one. This should be done inside the 
package. It's even broken at the moment because you are looking in a 
hardcoded PEAR path for the data files, but we should really look at 
PEAR's data_dir configuration variable.

Locales are not working properly either, I still have to look into 
that. But I want to get it commited, it lingered on my harddrive for 
too long.
11/25/2006 12:09:35 AM Jan Schneider Deleted Original Message
 
10/16/2006 01:56:58 PM webmaster (at) dasourcerer (dot) net Comment #11 Reply to this comment
This is not necessary, PHP abstracts the directory separators from
the underlying OS.
I supposed that. But you know... You can never be sure ;)
Since I've already tweaked your patch locally a bit, I suggest that
you keep your patched version, update once I've committed my version,
and then send a new patch with any remaining changes on your side.
I do not think there's going to be a lot of changes on my side. If at 
all. For me, it's working as intended. I'm just glad you like it :)
10/16/2006 01:43:35 PM Jan Schneider Comment #10 Reply to this comment
- Prevent the user from selecting the "Composite" driver
Technically there is no harm in doing so. The Composite driver is
used to add other holiday drivers so a set of drivers can be used. It
is already loaded and it doesn't make much sense to add the composite
driver to tha composite driver. So it's no longer available as an
option to the user.
I already changed this in my local copy.
- Generate the file location of the translation files in a platform
independent way
I've been using '/' all the time, now replaced with
DIRECTORY_SEPARATOR (Date_Holidays needs the full path to where its
translation files are kept). This might have prevented the
translation of holidays on non-unixoid systems.
This is not necessary, PHP abstracts the directory separators from the 
underlying OS.



Since I've already tweaked your patch locally a bit, I suggest that 
you keep your patched version, update once I've committed my version, 
and then send a new patch with any remaining changes on your side.
10/16/2006 01:30:30 PM webmaster (at) dasourcerer (dot) net Comment #9
New Attachment: dhpatch[1].diff Download
Reply to this comment
Here's an updated patch. There's nothing critical. However, it still 
would be better with these changes:



- Prevent the user from selecting the "Composite" driver

Technically there is no harm in doing so. The Composite driver is used 
to add other holiday drivers so a set of drivers can be used. It is 
already loaded and it doesn't make much sense to add the composite 
driver to tha composite driver. So it's no longer available as an 
option to the user.



- Generate the file location of the translation files in a platform 
independent way

I've been using '/' all the time, now replaced with 
DIRECTORY_SEPARATOR (Date_Holidays needs the full path to where its 
translation files are kept). This might have prevented the translation 
of holidays on non-unixoid systems.



Sorry for the inconvenience. I should have thought of this before.
10/15/2006 01:13:04 PM Jan Schneider Comment #8
Assigned to Jan Schneider
State ⇒ Assigned
Reply to this comment
Finally, great work!
10/14/2006 10:20:43 PM webmaster (at) dasourcerer (dot) net Comment #7
New Attachment: dhpatch.diff
Reply to this comment
So, here's my idea of how this can be done. I wrote a new driver 
acting as an interface between Kronolith and the Date_Holidays 
package. The user is able to select a set of holiday drivers. 
Furthermore, the code attempts to translate holidays names whenever 
possible.



The entire thing can be switched of by the site admin. Thanks to Jan 
and Chuck for their help with the UI part.



Oh, and Kronolith is also getting its very own test.php with this patch.
09/20/2006 04:37:22 PM Chuck Hagenbuch Comment #6
State ⇒ Accepted
Reply to this comment
Accepting, on the condition that Date_Holidays support should show up 
as additional calendar options to the user.
05/03/2006 05:51:25 PM webmaster (at) dasourcerer (dot) net Comment #5 Reply to this comment
There is one more advantage: Date_Holidays lets you select several 
filters for holidays. So you can decide easily wether you only want 
national holidays or national holidays and holidays of a certain 
religion or only later one. IMHO this is a lot more comfortable than 
having to importing several iCal files manually. Plus it is very easy 
to remove holidays from the display once you decide you no longer need 
them.
05/02/2006 09:54:30 PM Jan Schneider Comment #4 Reply to this comment
I'm a big fan of Date_Holiday since it's first appearance and 
integrating it into Kronolith has been on my personal todo list since 
then.

It has many advantages over remote calendars:

- It isn't remote. You don't need to rely on the remote resource being 
available.

- It works for an unfinite future. Some recurring holidays can't be 
covered by iCalendar recurrence rules and need to be specified for 
every year; the remote file needs to be actively maintained.

- It is localized. You can have holidays in your local language for a 
foreign country.

- Probably more...
05/02/2006 07:25:58 PM Matt Selsky Comment #3 Reply to this comment
What benefit does this module provide over remote calendars?  Maybe we 
just need to make it easier to find generic remote calendars (like 
national holidays, etc) by linking to a repo from the Kronolith 
website or within the Kronolith application itself?
05/02/2006 06:13:51 PM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
I still don't really like this idea, given that it's just a matter of 
adding a remote ical calendar. But I'm curious what others think...
05/02/2006 11:43:51 AM webmaster (at) dasourcerer (dot) net Comment #1
Priority ⇒ 1. Low
State ⇒ New
Queue ⇒ Kronolith
Type ⇒ Enhancement
Summary ⇒ Add support for Date_Holidays
Reply to this comment
I'd like to see support for the PEAR::Date_Holidays class to eliminate 
the need to add national and/or religious holidays by hand: 
<http://pear.php.net/package/Date_Holidays/>

I really hope this can be done...



I requested this already in ticket #2985. Since that proved to be the 
wrong place, I'm stating it here again :>

Saved Queries