Author: mcantelon
Date: Fri Jan 20 12:15:52 2012
New Revision: 10731

Log:
Added convenience function to log date parse errors.

Modified:
   trunk/lib/QubitFlatfileImport.class.php

Modified: trunk/lib/QubitFlatfileImport.class.php
==============================================================================
--- trunk/lib/QubitFlatfileImport.class.php     Fri Jan 20 11:28:35 2012        
(r10730)
+++ trunk/lib/QubitFlatfileImport.class.php     Fri Jan 20 12:15:52 2012        
(r10731)
@@ -102,7 +102,28 @@
   }
 
   /**
-   * Attempt to parse date from non-machine-readable text
+   * Attempt to parse date from non-machine-readable text,
+   * returning FALSE upon failure and logging failures.
+   *
+   * @param string $dateText  description of date
+   *
+   * @return string  date in YYYY-MM-DD format
+   */
+  public function parseDateLoggingErrors($dateText)
+  {
+    $date = $this->parseDate($dateText);
+    if ($date)
+    {
+      return $date;
+    } else {
+      $this->logError('Could not parse date: '. $dateText);
+      return FALSE;
+    }
+  }
+
+  /**
+   * Attempt to parse date from non-machine-readable text,
+   * returning FALSE upon failure.
    *
    * @param string $dateText  description of date
    *

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to