mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
- 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:
parent
88cd6de65f
commit
465498b36c
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user