πŸ‡ΊπŸ‡ΈUnited States @virtualmitra

Account created on 9 February 2012, over 13 years ago
#

Recent comments

πŸ‡ΊπŸ‡ΈUnited States virtualmitra

I answered my own question. Instead of using:
$insts = $rrule->getRuleInstances();
to get the list of all active instances from which the canceled dates have already been purge, I needed to use:
$insts = $rrule->makeRuleInstances();
to get a fresh list of all possible instances. Thus, the list of canceled dates can be created with:

$rrule = SmartDateRule::load($date_field_value['rrule']);
$instances = $rrule->makeRuleInstances();
$ovrds = $rrule->getRuleOverrides();
foreach($ovrds as $ind => $ovrd) {
      $instance = $instances[$ind];
      $canceled_dates[] = $instance->getStart()->format('M j');
}
Production build 0.71.5 2024