Smart Date Format in Views with Formatter set to Recurring

Created on 7 April 2023, over 1 year ago
Updated 26 August 2024, 4 months ago

Problem/Motivation

We have a standard event Content Type with a Smart Date Range field. Some events use recurring dates, others only have a single date, and rarely some have both. On the Event node everything displays properly. However, when we try to use a view to display events in a smaller card format as a block with the next 3 events and up to 4 of the next date instances for each of those events, the selected Smart Date Format only applies to the first event and not the subsequent events. We have tested deleting the current first event, and the formatting just shits down the chain to the next first one.


Steps to reproduce

  • Create a Smart Date Format that differs from default
  • Create 3 Events with a mix of recurring and an non recurring dates
  • Build a view to display the next 3 events
  • Add smart date field
  • Configure the smart date field
    • Set Formatter to Recurring
    • Set Smart Date Format to the one you created that differs from default
    • Check Force chronological
    • Check Add classes
    • Set Recent Instances to 0 (we don't want past dates on these cards)
    • Set Upcoming Instances to 5
    • Expand Multiple field settings
  • Create a display block
  • Place block and check results

Proposed resolution

Fix the Smart Date Formatter set for the view field so it apply to all query results and just not the first one.

πŸ› Bug report
Status

Active

Version

4.0

Component

Smart Date Recur

Created by

πŸ‡ΊπŸ‡ΈUnited States Zevarix Phoenix, Arizona

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

Comments & Activities

  • Issue created by @Zevarix
  • πŸ‡¦πŸ‡ΊAustralia tisteegz

    This is probably not helpful but I am having a similar issue with using views to output node teasers with dates.

    https://www.drupal.org/project/smart_date/issues/3362019 πŸ’¬ Smart date recurring formatter and layout builder Active

    The first one in the results renders correctly but the rest are wrong. I am stumped on how to troubleshoot it though. Are you using layout builder at all?

  • πŸ‡¦πŸ‡ΊAustralia tisteegz

    I have come back to this after a bit and I am having this exact same issue on Smart date 4.0.3 with Drupal 9.5.11

    I feel like this is a major issue as the longer the site exists the more unusable this becomes. Full node view works perfectly fine, but then the teasers on the view results page show incorrectly. All except the first result which works fine? Seems to me it's definitely a bug but I am really struggling to pinpoint where it is going wrong.

  • πŸ‡¨πŸ‡¦Canada mandclu

    Would it be possible to use a view mode instead of fields for your view display? It's possible that the recurring formatter doesn't work as well with views field otput.

  • First commit to issue fork.
  • πŸ‡¦πŸ‡ΊAustralia tisteegz

    Not the original issue reporter and it's been a while since I worked on this site but I believe I was using view modes as I don't ever use Fields as views output. I was using the teaser view mode and layout builder when I was getting this issue.

Production build 0.71.5 2024