Fix caching recurrent events' end date
This commit is contained in:
parent
f46ed48258
commit
c8f9065471
2 changed files with 8 additions and 2 deletions
|
@ -269,7 +269,7 @@ class caldav_driver extends kolab_driver
|
||||||
/**
|
/**
|
||||||
* Get the caldav_calendar instance for the given calendar ID
|
* Get the caldav_calendar instance for the given calendar ID
|
||||||
*
|
*
|
||||||
* @param string Calendar identifier (encoded imap folder name)
|
* @param string Calendar identifier
|
||||||
*
|
*
|
||||||
* @return ?caldav_calendar Object nor null if calendar doesn't exist
|
* @return ?caldav_calendar Object nor null if calendar doesn't exist
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -40,7 +40,13 @@ class kolab_storage_dav_cache_event extends kolab_storage_dav_cache
|
||||||
$sql_data['dtend'] = $this->_convert_datetime($object['end']);
|
$sql_data['dtend'] = $this->_convert_datetime($object['end']);
|
||||||
|
|
||||||
// extend date range for recurring events
|
// extend date range for recurring events
|
||||||
if (!empty($object['recurrence']) && !empty($object['_formatobj'])) {
|
if (!empty($object['recurrence'])) {
|
||||||
|
if (empty($object['_formatobj'])) {
|
||||||
|
$event_xml = new kolab_format_event();
|
||||||
|
$event_xml->set($object);
|
||||||
|
$object['_formatobj'] = $event_xml;
|
||||||
|
}
|
||||||
|
|
||||||
$recurrence = new kolab_date_recurrence($object['_formatobj']);
|
$recurrence = new kolab_date_recurrence($object['_formatobj']);
|
||||||
$dtend = $recurrence->end() ?: new DateTime('now +100 years');
|
$dtend = $recurrence->end() ?: new DateTime('now +100 years');
|
||||||
$sql_data['dtend'] = $this->_convert_datetime($dtend);
|
$sql_data['dtend'] = $this->_convert_datetime($dtend);
|
||||||
|
|
Loading…
Add table
Reference in a new issue