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

Forums / Developing with Sitefinity / I can't find how to remove the time

I can't find how to remove the time

2 posts, 0 answered
  1. joeldickson
    joeldickson avatar
    9 posts
    Registered:
    12 Feb 2007
    16 Apr 2009
    Link to this post
    I've had a request from one of my customers to remove the Time component of the date from the news articals. you can change the date format in the interface but not the time by the looks... am i missing something?

    Thanks in advance

    Joel
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Apr 2009
    Link to this post
    Hello joeldickson,

    Frontend.

    Open NewsView control designer, there you will find two sections - the first one is for each item, the second one is for the list of news items. There you will find property - Date . You can manage this property and set different format to your content items. You can add new data formats to the dropdown collection adding logic to the following template: TextSettingTemplate.ascx

    Mapping example:

    <viewSettings hostType="Telerik.Cms.Engine.WebControls.Design.Settings.TextSetting" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/TextSettingTemplate.ascx" /> 

    Adding date:

    <asp:Panel ID="dateTimeFormatPanel" runat="server"
                <asp:Label ID="lbl3" runat="server" Text="Date format" AssociatedControlID="dateTimeFieldFormat"></asp:Label> 
    <asp:DropDownList ID="dateTimeFieldFormat" runat="server"
                <asp:ListItem  Text="CustomFormat" Value="d"></asp:ListItem> 
    </asp:DropDownList> 

    For the backend we use raddatepicker control. You should be able to edit DateFormat property of DateInput.

    <telerik:raddatepicker ID="Publication_Date" runat="server"
                            <DateInput DateFormat="d" DisplayDateFormat="d"></DateInput> 
    </telerik:raddatepicker>  


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered