Closed (fixed)
Project:
Optional End Date
Version:
2.0.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Oct 2024 at 18:16 UTC
Updated:
12 Jan 2026 at 10:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
torfjComment #3
torfjComment #5
torfjTo resolve this, I added an additional check in the viewElements method to ensure that the start date is not displayed when the end date is absent and the field is configured to display only the end date.
I have created a merge request with the changes. The fix seems to work as expected in my tests now.
Please review the merge request and let me know your thoughts.
Thank you!
Comment #6
torfjUpdated the code to use the startDateIsDisplayed core function to check if the start date should be displayed.
Comment #7
danyg commentedIf somebody faces the similar issue but with 8.x-1.4 version, here is the improved patch that resolve this issue.
The current MR's changes don't resolve the issue properly, doesn't take account into the display settings
Comment #9
birk commentedI've committed patch #7 to branch 8, thank you for the work.
Should also fix #3540051: Changing date display does nothing (haven't tested).
Comment #11
birk commentedI'm sorry I haven't moved on this yet.
I was just about to make a new release when I realized this might break optional end date on earlier Drupal versions.
Some of the functions was first added in #2827055: Add option to show only start or end date in the DateTime Range custom formatter, which is Drupal 10.3, so for installations before that it would not work.
When I get some extra time I'll investigate a bit more.
But I think I'll end rolling this back, and then the best thing would be to update to optional end date 2 to get this feature, since it's already ^10.3.