Problem/Motivation
I have a node with a Smart Date Recur field. The formatter is configured to show the first upcoming recurring date instance. Once that date has passed, I expect it to show the first upcoming date after that. However, the output is cached and the past date instance is shown until I manually rebuild cache.
Steps to reproduce
1. Set up a content type with a recurring date field. My field.field.node.event.field_date_time.yml:
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_date_time
- node.type.event
module:
- smart_date
- smart_date_recur
third_party_settings:
smart_date_recur:
allow_recurring: true
month_limit: 12
id: node.event.field_date_time
field_name: field_date_time
entity_type: node
bundle: event
label: 'Date and time'
description: ''
required: true
translatable: false
default_value:
-
default_duration: 60
default_duration_increments: "30\r\n60|1 hour\r\n90\r\n120|2 hours\r\ncustom"
default_date_type: ''
default_date: ''
default_value_callback: ''
settings: { }
field_type: smartdate
2. Configure the formatter to show the first upcoming date. Field formatter settings taken from my core.entity_view_display.node.event.full.yml:
field_date_time:
type: smartdate_recurring
label: hidden
settings:
timezone_override: ''
format_type: medium
format: default
force_chronological: true
add_classes: false
time_wrapper: true
past_display: 0
upcoming_display: 1
show_next: true
current_upcoming: '1'
third_party_settings: { }
weight: 1
region: content
3. Wait for the first upcoming date to pass and see how the cached output remains the same.
Proposed resolution
Discuss! Maybe we can set a cache max age equal to the time until the next recurring date instance?
Remaining tasks
Fix, test.
User interface changes
none
API changes
none
Data model changes
none