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

Forums / Developing with Sitefinity / Change Publication_date format to short date

Change Publication_date format to short date

3 posts, 1 answered
  1. Nischal Jain
    Nischal Jain avatar
    8 posts
    Registered:
    19 Apr 2010
    10 Sep 2010
    Link to this post
    Hello,

    I am trying to shorten the date format of publication_date for News module. I tried to override the format in

    sitefinity/controltemplates/news/listpagedetails.ascx sitefinity/controltemplates/news/listpagedetails.ascx to
    <asp:Literal ID="Publication_Date" runat="server" DateFormatString="dd MMMM yyyy" >

    I am getting parser error. I am getting parser error.
    Server Error in '/news' Application.
    Parser Error
    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
     
    Parser Error Message: Type 'System.Web.UI.WebControls.Literal' does not have a public property named 'DateFormatString'.
     
    Source Error:
     
    Line 33:             <asp:Literal ID="Author" runat="server"></asp:Literal>
    Line 34:         </p>
    Line 35:         <p><asp:Literal ID="Publication_Date" runat="server" DateFormatString="dd MMMM yyyy" ></asp:Literal> </p>
    Line 36:        
    Line 37:        
     
     
    Source File: /news/Sitefinity/ControlTemplates/News/ListPageDetails.ascx    Line: 35

    Please, advise.
    Sincerely,
    Nishchal
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Sep 2010
    Link to this post
    Hi Nischal Jain,

    There is no such property for ASP.NET Literal control. You can use

    <telerik:DateTimeLiteral ID="Publication_Date" runat="server" DateFormatString="" />

    If you do not pass a valid data time format you will get a parse exception.

    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
    Answered
  3. Nischal Jain
    Nischal Jain avatar
    8 posts
    Registered:
    19 Apr 2010
    10 Sep 2010
    Link to this post
    Thanks Ivan. I was wondering that is applicable for only bound fields. But I just tried it anyway. Again , Thanks for quick response.
Register for webinar
3 posts, 1 answered