Add option to show only start or end date in the DateTime Range custom formatter

Created on 4 July 2024, 9 months ago
Updated 13 September 2024, 7 months ago

Problem/Motivation

Since Drupal 10.3, the core DateTimeRangeFormatter has an option to show only the start or the end date of a DateTimeRange field. This option should be available in this module's formatter as well.

Proposed resolution

In OptionalEndDateDateTimeRangeTrait::viewElements(), use the new method renderStartEndWithIsoAttribute() instead of rendering the date ourselves.

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany mrshowerman Munich

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

Merge Requests

Comments & Activities

  • Issue created by @mrshowerman
  • Issue was unassigned.
  • Status changed to Needs review 9 months ago
  • 🇩🇰Denmark Birk

    Yes you are absolutely right!

    This will break on sites using a core version older than 10.3.x so I'll make a new 2.x version of optional_end_date with these changes.

    It's primary administrative work on my part, but I still need to find the time to do this.
    Hopefully I'll get around to it soon.
    I'm unsure of how the merge request works against a new branch, with credits and all. I'll make an update in this issue if I need you to update the merge request to keep credits, maybe it's all done automatically never tried it don't know.

  • 🇩🇪Germany mrshowerman Munich

    Thanks for the update!
    Just let me know if you need help with the MR.

  • Pipeline finished with Skipped
    7 months ago
    #281985
  • Status changed to Fixed 7 months ago
  • 🇩🇰Denmark Birk

    Thank you for the merge

    I've created a new v2 branch, updated the core requirements and merged the request.

    I'll try to find the time next week to make a v2 release so this gets out there. Thanks again for your code and patience.

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

Production build 0.71.5 2024