From: Ben Klang Date: Thu, 10 Jun 2010 16:25:23 +0000 (-0400) Subject: Hermes: convert timestamps coming from the database into Horde_Date objects X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=91a5163263bf4d6c0be4f84d6ce1649221e267c7;p=horde.git Hermes: convert timestamps coming from the database into Horde_Date objects --- diff --git a/hermes/lib/Driver/sql.php b/hermes/lib/Driver/sql.php index caaac3131..df8b16e69 100644 --- a/hermes/lib/Driver/sql.php +++ b/hermes/lib/Driver/sql.php @@ -285,9 +285,14 @@ class Hermes_Driver_sql extends Hermes_Driver { return $hours; } - // Add cost object names to the results. - if (empty($fields) || in_array('costobject', $fields)) { - foreach (array_keys($hours) as $hkey) { + // Do per-record processing + foreach (array_keys($hours) as $hkey) { + // Convert timestamps to Horde_Date objects + $hours[$hkey]['date'] = new Horde_Date($hours[$hkey]['date']); + + // Add cost object names to the results. + if (empty($fields) || in_array('costobject', $fields)) { + if (empty($hours[$hkey]['costobject'])) { $hours[$hkey]['_costobject_name'] = ''; } else {