Problem/Motivation

On the Event Series settings page, the field Event Series Time Intervals says: "Enter the interval, in minutes, to be used to separate event start times. Default is 15 minutes."

The value entered in this field has no effect on what intervals are available when creating an Event Series. For example, if the default value of 15 is entered, the list of possible intervals for an event is simply the hard-coded values returned by RecurringEventsFieldTrait::getDurationOptions:

    $durations = [
      '900' => t('15 minutes'),
      '1800' => t('30 minutes'),
      '2700' => t('45 minutes'),
      '3600' => t('1 hour'),
      '5400' => t('1.5 hours'),
      '7200' => t('2 hours'),
      '9000' => t('2.5 hours'),
      '10800' => t('3 hours'),
      '12600' => t('3.5 hours'),
      '14400' => t('4 hours'),
      '16200' => t('4.5 hours'),
      '18000' => t('5 hours'),
      '19800' => t('5.5 hours'),
      '21600' => t('6 hours'),
      '25200' => t('7 hours'),
      '28800' => t('8 hours'),
      '32400' => t('9 hours'),
      '36000' => t('10 hours'),
      '39600' => t('11 hours'),
      '43200' => t('12 hours'),
      '46800' => t('13 hours'),
      '50400' => t('14 hours'),
      '54000' => t('15 hours'),
      '57600' => t('16 hours'),
      '61200' => t('17 hours'),
      '64800' => t('18 hours'),
      '68400' => t('19 hours'),
      '72000' => t('20 hours'),
      '75600' => t('21 hours'),
      '79200' => t('22 hours'),
      '82800' => t('23 hours'),
      '86400' => t('24 hours'),
    ];

Steps to reproduce

Go to /admin/structure/events/series/settings and enter any value into the Event Series Time Intervals field. Go to edit or create an Event Series and see this value has no effect on the Duration field.

Duration field settings

Proposed resolution

The getDuration() method should check the Event Series Time Intervals value and alter its output accordingly.

CommentFileSizeAuthor
image.png25.7 KBchrisla

Comments

chrisla created an issue.

chrisla’s picture

As a workaround you can override the getDuration value by using hook_recurring_events_durations_alter() in a custom module to get the intervals you want.