Skip to content

Commit

Permalink
Fix formatting of date fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jan 2, 2014
1 parent 4b88097 commit fca6af0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions turba/lib/Driver/Sql.php
Expand Up @@ -184,10 +184,10 @@ protected function _parseRead($blobFields, $result, $dateFields = array())
foreach ($row as $field => $val) {
if (isset($blobFields[$field])) {
$entry[$field] = $columns[$field]->binaryToString($val);
} elseif (isset($dateFields[$field])) {
} elseif (isset($dateFields[$field]) && !empty($val)) {
$d = new Horde_Date($val);
$entry[$field] = $this->_convertFromDriver(
$d->strftime($GLOBALS['attributes'][$field]['params']['format_in'])
$d->strftime($GLOBALS['attributes'][array_search($field, $this->map)]['params']['format_in'])
);
} else {
$entry[$field] = $this->_convertFromDriver($val);
Expand Down

0 comments on commit fca6af0

Please sign in to comment.