Event Dates Formatting and Display

Posted by Community Admin on 04-Aug-2018 16:32

Event Dates Formatting and Display

All Replies

Posted by Community Admin on 15-Oct-2011 00:00

Hey folks,

I am modifying the display template for a single event, and want to display the event dates and times. The default has:

 <sf:FieldListView ID="EventDates" runat="server" WrapperTagName="li" />   

Now this results in "17 - 17 Oct 2011" by default. Any ideas how to format this to include the time, or alternatively just to display the event start date as a fallback? Most of the events will be on a single day, but within a time frame, i.e. "5 - 8pm 17 Oct 2011"

Any suggestions would be appreciated.

Posted by Community Admin on 19-Oct-2011 00:00

Hello Neil,

You can add:

<sf:FieldListView ID="EventStart" runat="server" Format=" EventStart.ToLocal():MMM dd, yyyy hh:mm tt" />
<sf:FieldListView ID="EventEnd" runat="server" Format="EventEnd.ToLocal(): '\-' MMM dd, yyyy hh:mm tt"/>

which will display the correct time for the event. You can also change the initial EventDates string to modify the template even further. You may find the following forum thread useful:

http://www.sitefinity.com/devnet/forums/sitefinity-4-x/designing-styling/date-format.aspx#1664483

Greetings,
Victor Velev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed