Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Determine if a given DateTime is a member of a DateTime::Set

by vagabonding electron (Hermit)
on May 15, 2013 at 16:36 UTC ( #1033712=note: print w/ replies, xml ) Need Help??


in reply to Re: Determine if a given DateTime is a member of a DateTime::Set
in thread Determine if a given DateTime is a member of a DateTime::Set

Thank you very much fglock. Two more questions if you don't mind :-)

First: would you generally recommend to use DateTime::Event::Recurrence and DateTime::Event::ICal
instead of DateTime::Set ?

Second: not to promote my hack :-) but just to understand the things better: the code of the OP seems to work with DateTime::Set if the end point is defined ( Re^3: Determine if a given DateTime is a member of a DateTime::Set ) - is it just a coincidence? do you think it will break under other constellation?

Thanks again.


Comment on Re^2: Determine if a given DateTime is a member of a DateTime::Set
Re^3: Determine if a given DateTime is a member of a DateTime::Set
by fglock (Vicar) on May 16, 2013 at 08:26 UTC

    DateTime::Set is fine to use, but calendar math has these mysterious details, and recurrence specifications are particularly hard.

    The specialised "DateTime::Event" subclasses can make life easier. DateTime::Event::Sunrise and DateTime::Event::Cron are other nice examples.

    About the endpoint that makes it work: when both endpoints of the set are known, it triggers an optimisation that pre-calculates the whole set. The internal representation then changes to a list. This "fixes" the problem, because no further recurrence math is involved.

      Thank you for your time and of course for the modules (I should mention this earlier).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033712]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (13)
As of 2015-07-06 23:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls