mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-21 21:38:55 +01:00
fixing whole-day events get one day shorter when editing them in EGroupware (caused by yesterdays whole-day with timezone fix for TB)
This commit is contained in:
parent
5e12328a4d
commit
7ea6c338d3
@ -193,6 +193,7 @@ class DateTime extends \DateTime
|
||||
* Like DateTime::add, but additional allow to use a string run through DateInterval::createFromDateString
|
||||
*
|
||||
* @param DateInterval|string $interval eg. '1 day', '-2 weeks'
|
||||
* @returns DateTime the modified object to allow chaning
|
||||
*/
|
||||
public function add($interval) : \DateTime
|
||||
{
|
||||
|
@ -1559,7 +1559,9 @@ class calendar_boupdate extends calendar_bo
|
||||
}
|
||||
if (!empty($event['end']))
|
||||
{
|
||||
$time = $this->so->startOfDay(new Api\DateTime($event['end'], Api\DateTime::$user_timezone));
|
||||
// as EGroupware end of whole-day events is 1sec (or sometimes 60sec) shorter, we have to add 60sec,
|
||||
// before calling startOfDay to NOT lose one day
|
||||
$time = $this->so->startOfDay((new Api\DateTime($event['end'], Api\DateTime::$user_timezone))->add('60seconds'));
|
||||
$time->add('-1second');
|
||||
$event['end'] = Api\DateTime::to($time, 'ts');
|
||||
$save_event['end'] = $time;
|
||||
|
Loading…
Reference in New Issue
Block a user