[PP-1] Allow end date to be optional (date_recur)

Created on 10 October 2017, about 7 years ago
Updated 5 November 2024, 28 days ago

I added the ability to suppress the end date. In D7 I could choose start/end/both. This is needed for calendar views of items that display as lists of dates. I added a checkbox to suppress the end but this could be changed based on desires. I will list the changes. Should this be pushed forward as is or changed?

DateRecurDefaultFormater
31:

return array(
      // Implement default settings.
      'show_rrule' => TRUE,
      'show_next' => 5,
      'occurrence_format_type' => 'medium',
      'count_per_item' => TRUE,
        'show_enddate' => TRUE,
    ) + parent::defaultSettings();
  }

57:

  $form['show_enddate'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Show end date'),
      '#default_value' => $this->getSetting('show_enddate'),
    ];

110:

if (($start_date->format('U') !== $end_date->format('U')) && $showEnd) {
      $element = [
        'start_date' => $this->buildDateWithIsoAttribute($start_date),
        'separator' => ['#plain_text' => ' ' . $this->getSetting('separator') . ' '],
        'end_date' => $this->buildDateWithIsoAttribute($end_date),
      ];
    }

167:

build['#date'] = $this->buildDateRangeValue($item->start_date, $item->end_date,FALSE,$this->getSetting('show_enddate'));
✨ Feature request
Status

Postponed

Version

3.9

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ladew222

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024