I'm trying to save an event recurrence pattern into a database, such that after I fetch a row, I can ask "->next" ? To see the next event.

Specifically, I am expecting users to store "weekly", "quarterly" and "quarterly, but one week later" in the field. I then need to query the database for "any resource available in date range a--b," but I'll actually be fetching the whole table and querying it in Perl, because we're trying to stay database agnostic.

It looks like the most widely recognised formats are cron and iCal. I can't seem to find good CPAN support for iCal recurrences. The DateTime::Event::Cron module looks very good, but cron won't directly store quarters; you need two entries. There's also DateTime::Event::Recurrence, but that seems to have no serialization/inflation. Maybe I could dump the object as perl and store that in the database, but yuck.

Does anyone have any good suggestions for this? Thanks



- Boldra

In reply to Serialzed Date Recurrence by Boldra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.