Re: Recurring set does not correctly calculate dates for second Friday of the month.
[email protected] (Eric Jensen) Wed, 1 Mar 2017 21:10:13 -0500
| Newsgroups | perl.datetime |
|---|---|
| Message-ID | <[email protected]> |
Hi all, > On Mar 1, 2017, at 8:47 PM, Marius Feraru <[email protected]> wrote: > > ++ make sure you agree with your party what's what, as, for instance, some will say "second Friday of September 2017 is 15th", while others say to be "8th"… and so on. Sorry, I know it's ugly. ;-) > Marius, I didn’t understand your comment here. Isn’t this a question with only one answer, not a matter of having to agree beforehand? i.e. isn’t the second Friday of September 2017 *really* the 8th? Also, looking at the week_start_day parameter, wouldn’t ‘1fr’ work better? (Then we start counting on the first Friday, so we really get the second Friday correctly.) For me, that gives Sept. 8 as the second Friday of Sept. 2017, anyway. :-) Likewise for Dec. 8. Also, I’ll note that the docs for DateTime::Event::Recurrence give an example that’s exactly like the original poster’s code: # second tuesday of every month my $set = DateTime::Event::Recurrence->monthly( weeks => 2, days => 2 ); so maybe that should be clarified. Also, since the docs say “The week_start_day parameter is intended for internal use…” that initially implied to me that it shouldn’t be set by a caller - so I wonder if there’s another way to clarify that in the docs. Eric