Problem/Motivation

Formatting the output of smart date as per the below iterations:
Single date example:
13 June 2021
10:00am - 11:00am

Event spans multiple dates example:
13 June 2021 10:00am -
14 June 2021 11:00am

Multiday example:
13 June 2021
10:00am - 11:00am

14 June 2021
10:00am - 11:00am

Steps to reproduce

No option available for customizing the output of the date and time of the custom field formatter

Proposed resolution

Template can be created for the output of the smart date field so that the wrapper and classes can be added for the start date & time and end date & time of the output of the custom field formatter

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Ankit Agrawal created an issue. See original summary.

ankit agrawal’s picture

Status: Active » Needs work
ankit agrawal’s picture

Issue summary: View changes
mandclu’s picture

Can you provide an example of the markup you want, that can't currently be achieved?

ankit agrawal’s picture

Sure, one of the examples of the required markup for the multi-day event is following:

<div class='smart-date-start-datetime'>09 January 2021 11:00am </div>- <br><div class='smart-date-end-datetime'>16 January 2021 12:00pm</div>

Current markup with the custom field formatted of the smart date module:

<div>09 January 2021<br>11:00am - 16 January 2021<br>12:00pm</div>

Just having any identifier for the start datetime and end datetime will also work here.

mandclu’s picture

Status: Needs work » Active

You should be able to add the extra wrappers by doing a preprocess in your theme, for example using hook_preprocess_node().

Also, please don't set an issue's status to "Needs work" unless there is code to work on. This status is meant to convey existing code that needs additional work, not an issue that needs work to start. :)

ankit agrawal’s picture

Noted. Thank you!

mandclu’s picture

Status: Active » Closed (works as designed)