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

Forums / General Discussions / Textfield and DataFormat

Textfield and DataFormat

5 posts, 0 answered
  1. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    13 May 2011
    Link to this post
    Hello,
    I'm tring to use a sitefinity:textfield in a download list (list type, not table) for showing a data and I've set DataFormat to DataFormat="{0:dd/MM/yyyy}", it won't format my data ... I still see the time...what am I doing wrong?
    Thanks
    Paolo
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    16 May 2011
    Link to this post
    Hi Paolo,

    It looks like that we do not set this property in our code. Is it possible to use FieldListView and its property Format

    Kind regards,
    Ivan Dimitrov
    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
  3. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    18 May 2011
    Link to this post
    Hello Ivan,
    I got no luck.......doing  :

    <sitefinity:FieldListView runat="server" ID="test" Format="dd/MM/yyyy" Properties="DateCreated" />
      
    or
      
    <sitefinity:FieldListView runat="server" ID="test" Format="{0:dd/MM/yyyy}" Properties="DateCreated" />

    won't do anything...what am I doing wrong?
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    23 May 2011
    Link to this post
    Hi Paolo,

    You can either try using text field and format it using serverside expressions:
    <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# ((DateTime)Eval("DateCreated")).
    ToString("dd/MM/yyyy")
    %>' />

    or
    Best wishes,
    Radoslav Georgiev
    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
  5. Mark
    Mark avatar
    22 posts
    Registered:
    16 Sep 2012
    14 Oct 2011
    Link to this post
    For Sitefinity 4, answer here
    <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("EventStart", "{0:MMM dd}")%>' />
    Mark
5 posts, 0 answered