@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support RRULE "COUNT" for recurring events

Summary:
Ref T10747. RRULE events can repeat "UNTIL" a certain time, or a certain "COUNT" of times.

In the UI, we only support "UNTIL". Also support "COUNT".

Test Plan: Imported an event which repeats every other day, 5 times. Got 5 instances.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16749

+30 -1
+3
src/applications/calendar/import/PhabricatorCalendarImportEngine.php
··· 403 403 $until_datetime->setViewerTimezone($timezone); 404 404 $event->setUntilDateTime($until_datetime); 405 405 } 406 + 407 + $count = $rrule->getCount(); 408 + $event->setParameter('recurrenceCount', $count); 406 409 } 407 410 408 411 return $event;
+5
src/applications/calendar/query/PhabricatorCalendarEventQuery.php
··· 633 633 PhabricatorCalendarEvent $event, 634 634 $raw_limit) { 635 635 636 + $count = $event->getRecurrenceCount(); 637 + if ($count && ($count <= $raw_limit)) { 638 + return ($count - 1); 639 + } 640 + 636 641 return $raw_limit; 637 642 } 638 643
+22 -1
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 226 226 return null; 227 227 } 228 228 229 + $limit = $sequence + 1; 230 + $count = $this->getRecurrenceCount(); 231 + if ($count && ($count < $limit)) { 232 + return null; 233 + } 234 + 229 235 $instances = $set->getEventsBetween( 230 236 null, 231 237 $this->newUntilDateTime(), 232 - $sequence + 1); 238 + $limit); 233 239 234 240 return idx($instances, $sequence, null); 235 241 } ··· 907 913 $rrule->setUntil($until); 908 914 } 909 915 916 + $count = $this->getRecurrenceCount(); 917 + if ($count) { 918 + $rrule->setCount($count); 919 + } 920 + 910 921 return $rrule; 922 + } 923 + 924 + public function getRecurrenceCount() { 925 + $count = (int)$this->getParameter('recurrenceCount'); 926 + 927 + if (!$count) { 928 + return null; 929 + } 930 + 931 + return $count; 911 932 } 912 933 913 934 public function newRecurrenceSet() {