Output from Sunbird 0.7 fails to be parsed correctly by the date_api function of date_ical_parse_date. This function fails on a string where there's a VALUE= property before a TZID property and then the date.

I have refactored the code significantly so that it can handle a much larger variation in date field lines. If a VALUE attribute exists, it is also used to assist with parsing to simplify the process. Using the DATE_REGEX_LOOSE regular expression then becomes a last resort if no time format is defined.

Related to maintaining this module, the options within the component select box can be renamed and it would be nice if each individual module within the Date module became its own component so that we could be more detailed on these issue reports.

Comments

Susurrus’s picture

Status: Active » Needs review
Susurrus’s picture

StatusFileSize
new3.58 KB

Rerolled against HEAD. Granularity values had to be updated.

karens’s picture

Version: 7.x-1.x-dev » 5.x-2.x-dev

Can you re-roll your patch to work with the latest code? And switch to the 5.2 version instead of HEAD, HEAD is now being ported to work with Drupal 6.

We're wondering if this patch would fix http://drupal.org/node/217898.

Susurrus’s picture

StatusFileSize
new3.58 KB

Rerolled against latest 5.2.

Some issues still with this:

  • I define DATE_REGEX_ICAL_DATETIME and DATE_REGEX_ICAL_DATE right above the function. These should be merged with the other standard regexes at the top of date_api.module
  • Granularity is still added to parsed dates. This should be modified so that granularity makes sense. Maybe having 'date' and 'datetime' being the two options instead of crazy arrays
karens’s picture

Status: Needs review » Fixed

That patch is against an old version of HEAD, so I had to back up to get it. Granularity is no longer used in the latest code, so I took that out. The type to test should be DATE-TIME rather than DATETIME, according to the ical specs, so I changed that, too.

Other than that it looks good and I've committed it.

Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.