Parse date-only DUE fields (Bug #8644).
authorJan Schneider <jan@horde.org>
Thu, 15 Oct 2009 16:16:35 +0000 (18:16 +0200)
committerJan Schneider <jan@horde.org>
Thu, 15 Oct 2009 16:16:35 +0000 (18:16 +0200)
nag/lib/Task.php

index e4f1f44..4f4338a 100644 (file)
@@ -925,8 +925,12 @@ class Nag_Task {
         }
 
         $due = $vTodo->getAttribute('DUE');
-        if (!is_array($due) && !is_a($due, 'PEAR_Error') && !empty($due)) {
-            $this->due = $due;
+        if (!is_a($due, 'PEAR_Error')) {
+            if (is_array($due)) {
+                $this->due = mktime(0, 0, 0, (int)$due['month'], (int)$due['mday'], (int)$due['year']);
+            } elseif (!empty($due)) {
+                $this->due = $due;
+            }
         }
 
         // vCalendar 1.0 alarms