More in this section

Forums / General Discussions / Widget Template: Event StartDate Format

Widget Template: Event StartDate Format

2 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    03 Dec 2008
    10 Apr 2011
    Link to this post
    What's the syntax in the widget templates to allow me to format the startdate to the following format

    "MMM dd"

    I see there's a DateField I can use but keeps throwing an exception on me
    <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("EventStart") %>' Format="{0:MMM dd}" />

  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    30 Oct 2017
    11 Apr 2011
    Link to this post
    Hi Steve,

    You can define the format for this field like this:

    <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("EventStart", "{0:dd MMM}")%>' />

    Inserting this can also achieve the desired functionality:
    <br><strong>Event Start:</strong></br>
    <sf:FieldListView ID="EventStartDate"runat="server"Format=" {PublicationDate.ToLocal():  dd MMM}"/>

    Best wishes,
    Boyan Barnev
    the Telerik team

2 posts, 0 answered