Smart Date sources not showing in Month Settings

Created on 16 April 2024, 8 months ago
Updated 6 May 2024, 8 months ago

Problem/Motivation

We want a calendar displaying events on their start date. We are using the calendar-view and smart_date modules.

The problem is that events are displayed on every day of their range (between their start and end dates). In our case this makes the calendar unreadable as our events (eg courses) last for months.

Steps to reproduce

Our date field 'field_dates' is a Smart Date Range type but we do not allow Recurring Date Values.

In Views I can add various Smart Date fields eg field_dates:end_value. There is no field_dates:start_value although there is a description 'The start of the specified date/time range.' which has no a machine name. [Should there be a field_dates:start_value?]

Whatever type of field I add, the Month Settings will only recognise one field - field_dates. Other Smart Date fields eg field_dates_value are not recognised by the Month Settings.

In the field_dates field formatter I can select the Start Time Part using 'Smart Date Formatter' or 'Recurring'. I've tried loads of settings with both formatters. All display our events on every day of their range. What I've tried -
- Recurring formatter with the Start time part with zero past instances and zero upcoming. Also with "Display all values in the same row" checked in the "MULTIPLE FIELD SETTINGS" fieldset, without anything in the "Separator" field.
- Smart Date formatter with the Start time part
- grouping both on the date range field and on a start date field
- aggregation

Proposed resolution

The docs say, 'You can use any type of date field such as default date field, date range, smart_date, recurring date fields...etc.'
I feel like all the Smart Date field types should show up in the Month Settings so I can pick...... Is that the case?
ATM I can add different Smart Date field types to the view but only one of them shows up in Month Settings to build the calendar.

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇬🇧United Kingdom nigelwhite Marsden

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

Merge Requests

Comments & Activities

  • Issue created by @nigelwhite
  • 🇬🇧United Kingdom nigelwhite Marsden
  • 🇬🇧United Kingdom nigelwhite Marsden

    More information:

    I've tested this on a vanilla D10 site. The behaviour is the same - ie an event with a range of several days will appear in the calendar on every day of its range. There appears no way of getting it to display only on its start date.

    The field is still type = Smart Date Range but this time the settings are simpler -
    - field storage is limited to 1 value so there is no 'multiple values' in the views field formatter. This removes one source of my confusion.
    - the Smart Date Recurring module is not installed

    What made no difference -
    - grouping on the Smart date field
    - adding a Smart date Start Date field - this did not show up in Month Settings
    - add a entity_id field - all the events had id = 0
    - add a content id field - though each event had its own id there was no grouping
    - aggregation - no events in calendar

    Maybe, after all, the calendar works as designed?? If someone could confirm it would put me out of my misery (-:

  • Status changed to Postponed: needs info 8 months ago
  • Sorry for the inconvenience @nigelwhite... but I'm not sure to fully understand what you are trying to acheive.

    By design an event will be displayed every day it occurs. I think I am missing something, i'm sorry.

    What would you like the calendar to display?

  • 🇬🇧United Kingdom nigelwhite Marsden

    Thank you for writing.

    Our events (eg courses) last for months. We'd like a calendar which displays each event on its start date only. So, in the screenshot, the Multi day event would only appear on the 23rd and occupy only one day - just like the One day event.

    We're using a Smart Date Range field.

    You say, "By design an event will be displayed every day it occurs." So I guess this use case is out of scope?

  • Status changed to Needs review 8 months ago
  • I understand now, thank you for the explanations.

    I think I have it sorted in the attached merge request !32.

    Could you please try and let me know if it answer your need?

    With this patch applied, you should be able to place the start field in your View and then select it as the date field in the calendar settings. Then your events will be displayed on their "start" date only.

    Looking forward to hearing from you.

  • 🇬🇧United Kingdom nigelwhite Marsden

    Yes, that patch does the trick.

    Many thanks

  • Pipeline finished with Skipped
    8 months ago
    #153414
  • Status changed to Fixed 8 months ago
  • TY for your review.

    Marking this issue as fixed now.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024