? .DS_Store
? tests/.DS_Store
? tests/feeds/.DS_Store
Index: includes/ParserIcalFeedsParser.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/parser_ical/includes/ParserIcalFeedsParser.inc,v
retrieving revision 1.1
diff -u -r1.1 ParserIcalFeedsParser.inc
--- includes/ParserIcalFeedsParser.inc	19 Jan 2010 11:55:42 -0000	1.1
+++ includes/ParserIcalFeedsParser.inc	15 Mar 2010 20:38:05 -0000
@@ -28,14 +28,24 @@
       $this->end = new FeedsDateTime($feed_element['DTEND']['datetime'], $timezone);
     }
     if ($feed_element['DTSTART']['all_day']) {
-      // All day event; remove time granularity, set to = from
+      // All day event; remove time granularity.
+      // The end already = start because date_api_ical.inc sets that
+      // on line ~208
+      // @TODO make date_api_ical pass through the real end date and
+      // deal with here, ie 2001-01-02 to 2001-01-03 is USUALLY just
+      // a single day event. date_api_ical.inc overdoes this and
+      // resets even multiple day events to 1 day.
       $this->start->setTime(0, 0, 0);
       $this->start->removeGranularity('hour');
       $this->start->removeGranularity('minute');
       $this->start->removeGranularity('second');
-      $this->end = clone $this->start;
+      if($this->end) {
+        $this->end->setTime(0, 0, 0);
+        $this->end->removeGranularity('hour');
+        $this->end->removeGranularity('minute');
+        $this->end->removeGranularity('second');
+      }
     }
-
     if (array_key_exists('RRULE', $feed_element) && !empty($feed_element['RRULE']) && module_exists('date_repeat')) {
       include_once('./'. drupal_get_path('module', 'date_repeat') .'/date_repeat_calc.inc');
       include_once('./'. drupal_get_path('module', 'date') .'/date_repeat.inc');
Index: tests/parser_ical_feeds.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/parser_ical/tests/parser_ical_feeds.test,v
retrieving revision 1.1
diff -u -r1.1 parser_ical_feeds.test
--- tests/parser_ical_feeds.test	19 Jan 2010 11:55:42 -0000	1.1
+++ tests/parser_ical_feeds.test	15 Mar 2010 20:38:05 -0000
@@ -59,8 +59,8 @@
   public function createConfiguredFeed() {
     // Create content type.
     $typename = $this->createContentType(NULL, array(
-      'datefield' => array('type' => 'date', 'settings' => array('todate' => 'optional', 'tz_handling' => 'date'), ),
-      'datesite' => array('type' => 'date', 'settings' => array('todate' => 'optional', 'tz_handling' => 'site'), ),
+      'datefield' => array('type' => 'date', 'settings' => array('todate' => 'optional', 'tz_handling' => 'date', 'granularity_flexible'=>1), ),
+      'datesite' => array('type' => 'date', 'settings' => array('todate' => 'optional', 'tz_handling' => 'site', 'granularity_flexible'=>1), ),
     ));
 
     // Create and configure importer.
@@ -107,11 +107,11 @@
       array('title' => 'No timezone this time', 'field' => '2009-09-01 19:00', 'site' => '2009-09-01 19:00', 'field2' => '2009-09-01 20:00', 'site2' => '2009-09-01 20:00', 'timezone' => 'Pacific/Apia'),
       array('title' => 'UTC demarked with Z, over midnight.', 'field' => '2009-09-30 19:00', 'site' => '2009-09-30 08:00', 'field2' => '2009-10-01 20:00', 'site2' => '2009-10-01 09:00', 'timezone' => 'UTC'),
       // FAILING :: next is taking the time and then moving the zone so it doesn't end up all day
-      array('title' => 'No timezone whole day', 'field' => '2009-10-02 00:00', 'site' => '2009-10-02 00:00', 'field2' => '2009-10-02 00:00', 'site2' => '2009-10-02 00:00', 'timezone' => 'Pacific/Apia'),
+      array('title' => 'No timezone whole day', 'field' => '2009-10-02', 'site' => '2009-10-02', 'field2' => '2009-10-02', 'site2' => '2009-10-02', 'timezone' => 'Pacific/Apia'),
       // FAILING :: working out the all day but then moving the timezone as above
-      array('title' => 'Single day as created by ms and google.', 'field' => '2009-01-05 00:00', 'site' => '2009-01-05 00:00', 'field2' => '2009-01-05 00:00', 'site2' => '2009-01-05 00:00', 'timezone' => 'Pacific/Apia'),
+      array('title' => 'Single day as created by ms and google.', 'field' => '2009-10-05', 'site' => '2009-10-05', 'field2' => '2009-10-05', 'site2' => '2009-10-05', 'timezone' => 'Pacific/Apia'),
       // FAILING :: as above plus it's putting in the wrong end date using whole single day rule rather than multiple day
-      array('title' => 'Multiple whole days', 'field' => '2009-10-05 00:00', 'site' => '2009-10-05 00:00', 'field2' => '2009-10-08 00:00', 'site2' => '2009-10-08 00:00', 'timezone' => 'Pacific/Apia'),
+      array('title' => 'Multiple whole days', 'field' => '2009-10-05', 'site' => '2009-10-05', 'field2' => '2009-10-08', 'site2' => '2009-10-08', 'timezone' => 'Pacific/Apia'),
     );
     foreach ($data as $d) {
       $n = node_load(array('title' => $d['title']), NULL, TRUE);
