Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 90346
Status: resolved
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: tangentsoft [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 6.41
Fixed in: (no value)



Subject: Allow holiday recurrence date range
I tried defining a multi-day holiday using recurrences: 0:0:0:1:0:0:0**20131221*20131221*20140104 = Winter Holiday I believe this says "every day between December 21, 2013 and January 3, 2014 inclusive". If not, then please substitute the correct recurrence. :) I eventually discovered that I could get the desired effect with this Event spec: 20131221 ; 20140103 = Winter Holiday However, that requires that I follow a false return from Date_IsHoliday() with a call to Events_List(), then check for an empty return. It would be nicer if Date_IsHoliday(ParseDate('Dec 28')) would return 'Winter Holiday'. Incidentally, it would be nice if the 'base' field weren't required here. If you give a date range, shouldn't it be able to guess that the base date is equal to the start date?
Almost by definition, holidays are single days. Although I could change that definition, I don't believe it's a very useful change as it would get used very infrequently and would increase the complexity of the holiday handling code a bit. Instead, in the rare instances where you need a multi-day holiday, just define them as separate 1-day holidays. In your case, you could just defined holidays as: Dec 21 : Winter Holiday Dec 22 : Winter Holiday ... Jan 3 : Winter Holiday in the HOLIDAYS section of your config file. Given that this works, and is actually pretty straightforward, I believe that that is the way to go here.