- Return errors in timestamp formatting so they can be displayed to user

- Make sure timestamps returned are timestamps, not DateTimes
This commit is contained in:
Nathan Gray 2012-02-06 16:23:33 +00:00
parent 88cd6de65f
commit 465498b36c

View File

@ -321,12 +321,19 @@ class importexport_import_csv implements importexport_iface_import_record { //,
if($format == 1)
{
$formatted = egw_time::createFromFormat(
egw_time::$user_dateformat . ', ' .egw_time::$user_timeformat,
egw_time::$user_dateformat . ' ' .egw_time::$user_timeformat,
$record[$name]
);
if(!$formatted && $errors = egw_time::getLastErrors())
{
foreach($errors['errors'] as $msg)
{
$warnings[] = $name . ': ' . $msg;
}
}
if($errors = egw_time::getLastErrors() && $errors['error_count'] == 0)
{
$record[$name] = $formatted;
$record[$name] = $formatted->getTimestamp();
}
}
@ -346,7 +353,7 @@ class importexport_import_csv implements importexport_iface_import_record { //,
$formatted = egw_time::createFromFormat(egw_time::$user_dateformat, $record[$name]);
if($errors = egw_time::getLastErrors() && $errors['error_count'] == 0)
{
$record[$name] = $formatted;
$record[$name] = $formatted->getTimestamp();
}
}
$record[$name] = egw_time::user2server($record[$name],'ts');