* Calendar: changing an existing, recurring event to whole-day, caused an end-time on day before start

This commit is contained in:
Ralf Becker 2013-06-07 11:54:26 +00:00
parent 3c41a61336
commit 020e58b764
2 changed files with 6 additions and 7 deletions

View File

@ -743,7 +743,7 @@ class calendar_bo
if ($event['whole_day'])
{
$time = new egw_time($event['end'], egw_time::$user_timezone);
$time =& $this->so->startOfDay($time);
$time = $this->so->startOfDay($time);
$time->setTime(23, 59, 59);
$end = $this->date2ts($time,true);
}
@ -938,7 +938,7 @@ class calendar_bo
{
if ((int) $this->debug >= 3 || $this->debug == 'set_recurrences' || $this->debug == 'check_move_horizont' || $this->debug == 'insert_all_recurrences')
{
$this->debug_message(__METHOD__.'(%1,%2,%3,&$event)',true,$event,$start,$end);
$this->debug_message(__METHOD__.'(%1,%2,%3,&$events)',true,$event,$start,$end);
}
$start_in = $start; $end_in = $end;
@ -965,7 +965,6 @@ class calendar_bo
}
$ts_end = $ts + $event_length;
// adjust ts_end for whole day events in case it does not fit due to
// spans over summer/wintertime adjusted days
if($event['whole_day'] && ($arr_end = $this->date2array($ts_end)) &&

View File

@ -999,27 +999,27 @@ class calendar_boupdate extends calendar_bo
if (!empty($event['start']))
{
$time = new egw_time($event['start'], egw_time::$user_timezone);
$time =& $this->so->startOfDay($time);
$time = $this->so->startOfDay($time);
$event['start'] = egw_time::to($time, 'ts');
$save_event['start'] = $time;
}
if (!empty($event['end']))
{
$time = new egw_time($event['end'], egw_time::$user_timezone);
$time =& $this->so->startOfDay($time);
$time->setTime(23, 59, 59);
$event['end'] = egw_time::to($time, 'ts');
$save_event['end'] = $time;
}
if (!empty($event['recurrence']))
{
$time = new egw_time($event['recurrence'], egw_time::$user_timezone);
$time =& $this->so->startOfDay($time);
$time = $this->so->startOfDay($time);
$event['recurrence'] = egw_time::to($time, 'ts');
}
if (!empty($event['recur_enddate']))
{
$time = new egw_time($event['recur_enddate'], egw_time::$user_timezone);
$time =& $this->so->startOfDay($time);
$time = $this->so->startOfDay($time);
$event['recur_enddate'] = egw_time::to($time, 'ts');
$time->setUser();
$save_event['recur_enddate'] = egw_time::to($time, 'ts');