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

Forums / Developing with Sitefinity / Formatiing the Blog date

Formatiing the Blog date

39 posts, 0 answered
  1. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Dec 2009
    Link to this post
    Hi Magnus,

    The sample will add a new item in the DropDownList as you can see from the declaration. You can use Standard Date and Time Format Strings as a value.


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  2. Magnus
    Magnus avatar
    28 posts
    Registered:
    26 May 2009
    14 Dec 2009
    Link to this post
    Hi again.

    Sorry. i think i'm kinda bad at explaining what i'm doing.. or i'm not so clever understanding. ;)

    i dont want to create a new dateformat. i just want to display the publication date in the format "mm/dd/yyyy" in the bloglist. Might be me, but shouldn't be relative easy and not needed to edit in adminsection?

    So. I did this trick instead. Dunno why i didnt thought of this solution before.

                <%# (DataBinder.Eval(Container.DataItem, "Publication_Date", "{0:dd-MM-yy}").ToString().Replace("-","/")) %>  

    But.. i'm curious in where i can see that DropDownList i'm creating in the admin section?  (your code).


    Thanks for the help / Magnus.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Dec 2009
    Link to this post
    Hi Magnus,

    The code I sent you adds a new Date format under the BlogPosts >> Blog Settings >> In the post page, display and For every post in the list page, display there is a TextSetting control called Date which controls how the date will be rendered by the control.

    Your approach is not good because you are hardcoding the format and no one will be able to change it from the UI.


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  4. Adeel Arif
    Adeel Arif avatar
    27 posts
    Registered:
    30 Dec 2009
    02 Feb 2010
    Link to this post
    Hi Vassil Daskalov,

    I was facing the problem that when in blogs List control i remove the format attribute from the "telerik:DateTimeLiteral".
    the time being displayed is 12:00 AM. Searching this i stumbled upon this post. Can u please Guide me to the solution of the problem ....... Is this fixed?

    Thanks .

    Regards
    Adeel Arif.
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Feb 2010
    Link to this post
    Hello Adeel Arif,

    Please take a look at this post which provide solution to your problem.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  6. H.J.E. Coppen
    H.J.E. Coppen avatar
    13 posts
    Registered:
    25 Nov 2008
    19 Feb 2010
    Link to this post
    Dear Ivan,

    I want to style the day, month and year form the Publication_Date in three different formats, on the ListPageDetails.ascx.

    How do I need to do this? On the ListPageMaster.ascx I used the Binder but that's not possible on the ListPageDetails, right? And using only MMMM in datefomat doesn't work.


    Greetings,

    Hugo Coppen
    VIA.nl
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    22 Feb 2010
    Link to this post
    Hello H.J.E. Coppen,

    Map TextSettingsTemplate and add your custom formats as suggested in the previous posts. You can control the date format from Date text settings under "BlogsSettings  >> In the post page, display:" section of BlogPosts control designer.

    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.
  8. H.J.E. Coppen
    H.J.E. Coppen avatar
    13 posts
    Registered:
    25 Nov 2008
    22 Feb 2010
    Link to this post
    Hello Ivan,

    Thank you for your quick response. 

    I'm not quite sure I know what you mean. How do I map the TextSettingsTemplate? And I'm not working on the date from an Blog but from an Newsitem. Here you can see what I mean by formatting in different styles, from the ListPageMaster.ascx.

    <div class="date">
        <span class="month"><%#DataBinder.Eval(Container.DataItem, "Publication_Date", "{0:MMMM}")%></span>
        <span class="day"><%#DataBinder.Eval(Container.DataItem, "Publication_Date", "{0:dd}")%></span>
        <span class="year"><%#DataBinder.Eval(Container.DataItem, "Publication_Date", "{0:yyyy}")%></span>
    </div>

    Greetings,

    Hugo Coppen
    VIA.nl
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    22 Feb 2010
    Link to this post
    Hi H.J.E. Coppen,

    BlogPosts and NewsView are ContentView based controls, so both controls uses TextSettingsTemplate. Anyhow, in the ListPageMaster template you have a repeater  - data bound control, since you do not have such control in ListPageDetails and you cannot use Container.DataItem.

    You need to create a custom control that inherits from NewsView and override SetSingleItemContent. Then call GetItemMetaData method of IContent object and split the format as you want.

    Greetings,
    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.
Register for webinar
39 posts, 0 answered
1 2