More in this section

Forums / Developing with Sitefinity / Event Dates Formatting and Display

Event Dates Formatting and Display

2 posts, 0 answered
  1. Neil
    Neil avatar
    30 posts
    Registered:
    20 Jan 2009
    15 Oct 2011
    Link to this post
    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.
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    19 Oct 2011
    Link to this post
    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
2 posts, 0 answered