+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / EventsView - Cannot show the time the event starts

EventsView - Cannot show the time the event starts

7 posts, 0 answered
  1. Eric Wallace
    Eric Wallace avatar
    66 posts
    Registered:
    08 Oct 2009
    21 Apr 2010
    Link to this post
    I've played around with numerous date format strings, but no matter what I do, the Event_Start date comes back with a time of 12:00 AM. I'm using the ContentViewSingleItemView.ascx external template. How can I show the time of the event?
  2. Eric Wallace
    Eric Wallace avatar
    66 posts
    Registered:
    08 Oct 2009
    21 Apr 2010
    Link to this post
    Please disregard as I found the solution by mapping the text settings template as described in this thread: http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/display-times-in-eventview.aspx, and added the following code to the dropdownlist:
               <asp:Panel ID="dateTimeFormatPanel" runat="server">
                <asp:Label ID="lbl3" runat="server" Text="wtf Date format" AssociatedControlID="dateTimeFieldFormat"></asp:Label>
                <asp:DropDownList ID="dateTimeFieldFormat" runat="server">
                  <asp:ListItem Value="f" text="Full Date and Short Time" />
                </asp:DropDownList>
                <p class="example">Example</p>
            </asp:Panel>

    The date is now being displayed like:
    Saturday, June 05, 2010 9:00 AM

    However, this is an issue that seriously needs to be resolved by Telerik, as it has been going on for a very long time now and has been reported many times. An event without a time is about as useful as a car without a steering wheel.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Apr 2010
    Link to this post
    Hi Eric Wallace,

    Thank for getting back to us. We will consider adding additional formats to the dropdown for the next SP of 3.7 version. The SP will be after Q2 release of  the RadControls for ASP.NET AJAX.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  4. Leonard
    Leonard avatar
    19 posts
    Registered:
    01 Dec 2005
    03 May 2010
    Link to this post
    Eric,

    Another possible solution when using external templates is to replace the standard ASP Literal controls that are used for "Event_Start" and "Event_End" with Telerik DateTimeLiteral controls and specify your custom format string using the "DateFormatString" property:

    Replace:

    <asp:Literal ID="Event_Start" runat="server" />

    With:

    <telerik:DateTimeLiteral ID="Event_Start" runat="server" DateFormatString="MMMM dd, yyyy 'at' h:mm tt" />

     

    This works with the default (unchanged) value for date format in the EventsView control settings. More details available here.

    I hope this helps --
  5. Eric Wallace
    Eric Wallace avatar
    66 posts
    Registered:
    08 Oct 2009
    03 May 2010
    Link to this post
    Thank you for the response Leonard. However, I tried using that solution originally and the time kept coming back as 12:00 a.m.

    - Eric
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 May 2010
    Link to this post
    Hi Eric Wallace,

    There are two options to use different format

    • Using  TextSettingsTemplate.ascx
    • Creating a custom class that inherits from EventsView and overriding SetitemMetaData method where you can create a new control that will show the contentItem Event_Start/Event_End metakeys in desired format.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. Brinley Ang
    Brinley Ang avatar
    2 posts
    Registered:
    09 Mar 2010
    06 Sep 2010
    Link to this post
    Hi Eric,

    I just encountered the same problem as you, event_start and event_end dates were missing the times.

    Turns out Leonard's solution was spot on but we just needed to revert MasterSettings and DetailSettings to default by clearing them otherwise the basic view sets those value to only display the date of event_start and event_end.

    I also noticed that in Advanced / Appearance / DatesFormats also allows the configuration of the datetime format globally throughout the template, which is useful as well.

    Regards,
    Brinley
Register for webinar
7 posts, 0 answered