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.

Comments

Rudi Teschner created an issue. See original summary.

rudi teschner’s picture

Having a check for day-spans works nice for me, but maybe this behavior would be better added into a setting

rudi teschner’s picture

Minor adjustment as it happened that end-date was listed in all-day area 1 day short.

mingsong’s picture

Status: Active » Needs work

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

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

luenemann’s picture

rudi teschner’s picture

@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