Subject: | Date arithmetic still shown in v6 documentation |
Date: | Thu, 6 Feb 2014 19:28:49 -0700 |
To: | bug-Date-Manip [...] rt.cpan.org |
From: | Warren Young <wyoung [...] tangentsoft.com> |
Date::Manip v6 doesn’t support date specifications like “4th Thu in Nov + 1 day” for “the day after Thanksgiving” any more. But, this very example still appears in the docs, apparently a v5 hold-over:
http://search.cpan.org/~sbeck/Date-Manip-6.42/lib/Date/Manip/Recur.pod
I’m pretty sure I’ve seen it elsewhere, too, but that might be older docs. I can’t find a second instance of this in the copy on cpan.org.
The docs should show the recurrence form:
1*11:4:5:0:0:0
That is, every year in the 11th month in the 4th week on day 5 at midnight.
You may be tempted to give an alternate form, which does work in v6 if Thanksgiving was previously defined as a holiday in ~/.DateManip.cnf:
1*11:4:4:0:0:0*NWD
Please don’t do this, as it doesn’t do the right thing in v5; apparently v5 doesn’t take the previous Thanksgiving definition into account when interpreting the NWD modifier. My alternative above is shorter and works in v5 and v6 as-is.
This recurrence should also be given as an example in Date::Manip::Holidays, since it’s likely to be wanted by many people defining holidays. I see no reason to make people reconstruct the recurrence themselves.