Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-05-04 01:18:43 +0400
committerBart Visscher <bartv@thisnet.nl>2012-05-04 01:18:43 +0400
commit077ea94f713773fe2cdc0a07bf2d8bc0977b6942 (patch)
tree02182bf62c3ede356d88c62c98fd3754c9bb05ca /apps/calendar
parentb62a8ba0f899cd882938c9d3832ed1d35f102ae5 (diff)
parent62da0bae432485d1fdec8c09ef96580332d2d43b (diff)
Merge commit 'refs/merge-requests/89' of git://gitorious.org/owncloud/owncloud
Conflicts: apps/calendar/ajax/events.php
Diffstat (limited to 'apps/calendar')
-rwxr-xr-xapps/calendar/ajax/events.php1
-rwxr-xr-xapps/calendar/lib/app.php19
2 files changed, 18 insertions, 2 deletions
diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php
index 2499c5163a2..b84f5b4c608 100755
--- a/apps/calendar/ajax/events.php
+++ b/apps/calendar/ajax/events.php
@@ -22,4 +22,3 @@ foreach($events as $event){
$output[] = OC_Calendar_App::generateEventOutput($event, $start, $end);
}
OCP\JSON::encodedPrint($output);
-?>
diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php
index e8fdbe8c78a..e457aac2c78 100755
--- a/apps/calendar/lib/app.php
+++ b/apps/calendar/lib/app.php
@@ -381,7 +381,17 @@ class OC_Calendar_App{
$start_dt->setTimezone(new DateTimeZone(self::$tz));
$end_dt->setTimezone(new DateTimeZone(self::$tz));
}
-
+
+ // Handle exceptions to recurring events
+ $exceptionDateObjects = $vevent->select('EXDATE');
+ $exceptionDateMap = Array();
+ foreach ($exceptionDateObjects as $exceptionObject) {
+ foreach($exceptionObject->getDateTimes() as $datetime) {
+ $ts = $datetime->getTimestamp();
+ $exceptionDateMap[idate('Y',$ts)][idate('m', $ts)][idate('d', $ts)] = true;
+ }
+ }
+
if($event['repeating'] == 1){
$duration = (double) $end_dt->format('U') - (double) $start_dt->format('U');
$r = new When();
@@ -398,6 +408,13 @@ class OC_Calendar_App{
if($result > $end){
break;
}
+ // Check for exceptions to recurring events
+ $ts = $result->getTimestamp();
+ if (isset($exceptionDateMap[idate('Y',$ts)][idate('m', $ts)][idate('d', $ts)])) {
+ continue;
+ }
+ unset($ts);
+
if($output['allDay'] == true){
$output['start'] = $result->format('Y-m-d');
$output['end'] = date('Y-m-d', $result->format('U') + --$duration);