Daterange fields not added to all-day area

Created on 22 August 2022, about 2 years ago
Updated 3 April 2023, over 1 year ago

Using daterange field content having different dates in start_date and end_date are not added to the all-day area but instead can flood the regular calendar if multiple content date spans over several days.

πŸ› Bug report
Status

Needs work

Version

5.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Rudi Teschner

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.

  • πŸ‡¦πŸ‡ΊAustralia mingsong πŸ‡¦πŸ‡Ί

    The end date could be empty, if it is not a Date range filed.

    The patch need to handle all situations (field types).

  • πŸ‡©πŸ‡ͺGermany luenemann SΓΌdbaden, Germany

    At a first loot this relates to ✨ Add functionality for all-day events Active .

  • πŸ‡©πŸ‡ͺGermany Rudi Teschner

    @mingsong: the empty-end-date-handling has not been altered by my suggestion

                // Deal with the end date in the same way as start date above.
                if (!empty($end_dates[$i])) {
                  if ($end_field_option['type'] === 'timestamp') {
                    $end_date = $end_dates[$i]['value'];
                    $end_date = intval($end_date);
                    $end_date = date(DATE_ATOM, $end_date);
                  }
                  elseif (strpos($end_field_option['type'], 'daterange') !== FALSE) {
                    $end_date = $end_dates[$i]['end_value'];
                  }
                  elseif (strpos($end_field_option['type'], 'datetime') === FALSE) {
                    // This field is not a valid date time field.
                    $end_date = '';
                  }
                  else {
                    $end_date = $end_dates[$i]['value'];
                  }
    
                  if (!empty($end_date)) {  <-- my changes start after this check
                    $all_day = (strlen($end_date) < 11) ? TRUE : FALSE;
    

    @luenemann: yeah, a little

Production build 0.71.5 2024