From 0e9e4ae32527d220aa45b9849d90e8d79cc95a6a Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 23 Apr 2012 16:32:34 +0000 Subject: [PATCH] Add in seconds, some timestamps have those and date doesn't parse otherwise --- etemplate/inc/class.bo_merge.inc.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index 68779d3803..bcf9343169 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -1052,17 +1052,23 @@ abstract class bo_merge $field = preg_quote($field, '/'); if($values[$key]) { - try { - $date = egw_time::createFromFormat( - '!'.egw_time::$user_dateformat . ' ' .egw_time::$user_timeformat, - $values[$key], - egw_time::$user_timezone - ); - - } catch (Exception $e) { - // Couldn't get a date out of it... skip it - trigger_error("Unable to parse date $key = '{$values[$key]}' - left as text", E_USER_NOTICE); - } + if(!is_numeric($values[$key])) + { + try { + $date = egw_time::createFromFormat( + '!'.egw_time::$user_dateformat . ' ' .egw_time::$user_timeformat.':s', + $values[$key], + egw_time::$user_timezone + ); + } catch (Exception $e) { + // Couldn't get a date out of it... skip it + trigger_error("Unable to parse date $key = '{$values[$key]}' - left as text", E_USER_NOTICE); + } + } + else + { + $date = new egw_time($values[$key]); + } if($mimetype == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')//Excel WTF { $interval = $date->diff(new egw_time('1900-01-00 0:00'));