Set date fields for spreadsheet date formatting, add date with nothing after it to list of potential formats for parsing into spreadsheet date

This commit is contained in:
Nathan Gray 2012-07-31 17:43:34 +00:00
parent 0fa472164e
commit 35bb3b6a87
2 changed files with 10 additions and 1 deletions

View File

@ -1041,6 +1041,7 @@ abstract class bo_merge
'!'.egw_time::$user_dateformat . ' ' .egw_time::$user_timeformat.':s',
'!'.egw_time::$user_dateformat . '* ' .egw_time::$user_timeformat,
'!'.egw_time::$user_dateformat . '*',
'!'.egw_time::$user_dateformat,
);
// Properly format values for spreadsheet

View File

@ -31,6 +31,13 @@ class filemanager_merge extends bo_merge
protected $numeric_fields = array(
);
/**
* Fields that are dates or timestamps
*/
public $date_fields = array(
'mtime', 'ctime'
);
/**
* Business object to pull records from
*/
@ -123,7 +130,8 @@ class filemanager_merge extends bo_merge
// Format date cfs per user preferences
if($field['type'] == 'date' || $field['type'] == 'date-time')
{
$file['#'.$name] = egw_time::to($file['#'.$name]);
$this->date_fields[] = '#'.$name;
$file['#'.$name] = egw_time::to($file['#'.$name], $field['type'] == 'date' ? true : '');
}
}
}