Hi,
I'm looking for some advice. What I want to be able to do is to determine if a particular datetime is in a set of ranges given by the user. I am hoping to be able to have some SpanSet type object I can just call "contains" on.
My problem is the user will want to give specifications like Monday-Friday 9-5 rather than specific dates. I can't see how to support this using the DateTime modules so I was hoping someone could point me the right way.
I can make a DateTime::Incomplete from the start and stop times of each day. I thought I could then use to_recurrence to get a DateTime::Set for starts and one for stops. Then use DateTime::SpanSet->from_sets but that errors out with:
days cannot be zero at /usr/local/lib/perl5/site_perl/5.8.4/DateTime/Event/Recurrence.pm line 723.
The 'days' parameter (undef) to DateTime::Duration::new was an 'undef', which is not one of the allowed types: scalar
at /usr/local/lib/perl5/site_perl/5.8.4/DateTime/Event/Recurrence.pm line 141
Any ideas?
Thanks,
Andrew