Generated with the help of an LLM.
Problem/Motivation
With Optional End Date a date range may have a start only. Date reached on the end of such a range falls back to its start ("A range without an end ends at its start"). A template "after the end of the event" therefore goes out at the event's start time, and one with the offset "3 days" three days after the start, while the site may still list the event as running for the rest of that day.
A common reading of an open end is "current until the end of the day it starts on". The condition cannot express that, and an offset cannot replace it, because the distance from the start to the end of its day differs with every start time.
Proposed resolution
- A new setting on Date reached, key
open_end, labelled "A date range without an end ends":start: "at its start" (default, today's behaviour);start_day: "at the end of its start day in the site's timezone" (23:59:59 of the start day, the day taken in the site's timezone, plus the offset).
- It only applies to part end of a range with a time of day whose end is empty. A range with an end ends there; a date-only range without an end already ends with its start day.
- Templates saved before carry no
open_endand getstartthrough the plugin's default configuration, so no update hook is needed. - Kernel test in
FieldConditionsTest: default, end of start day plus offset, a start late in the evening (UTC) that falls on the next day in the site's timezone, a range with an end, the start part unaffected, normalisation of unknown values. - README (table of conditions) and CHANGELOG updated.
Builds on #3635036 for the site timezone.
Remaining tasks
- Review.
- Translations on localize.drupal.org for the four new strings (context
conditional_notification).
User interface changes
One more radio group in the settings of Date reached: "A date range without an end ends", with a description saying it only applies to the end of a date range with a time of day.
API changes
DateReached::dateTimestamp() gets an optional third parameter bool $open_end_start_day = FALSE.
Data model changes
The condition settings get the key open_end (start | start_day); absent means start.
Issue fork conditional_notification-3635037
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tkasecker commentedComment #4
tkasecker commentedRegarding remaining task "Translations on localize.drupal.org for the four new strings": I'm currently reviewing the current translations for this project and I will include the new translations as well when I upload the whole updated .po to localize.drupal.org.
Comment #6
daniel.pernold commentedReleased in 2.0.0-alpha29.