show error, not exception
[bdrem.git] / src / bdrem / Renderer.php
index e6f633b5e5138e1ed9aebff935a031ab14dd9702..363d413de11ae6923a62a7ba50892096f24dae33 100644 (file)
@@ -18,5 +18,19 @@ abstract class Renderer
     }
 
     abstract public function render($arEvents);
+
+    protected function getLocalDate($dateStr)
+    {
+        if ($dateStr{0} != '?') {
+            return strftime('%x', strtotime($dateStr));
+        }
+
+        $dateStr = str_replace('????', '1899', $dateStr);
+        return str_replace(
+            array('1899', '99'),
+            array('????', '??'),
+            strftime('%x', strtotime($dateStr))
+        );
+    }
 }
 ?>