More in this section

Forums / General Discussions / Breaking up the publication date

Breaking up the publication date

2 posts, 0 answered
  1. Gaston County
    Gaston County avatar
    38 posts
    Registered:
    23 Feb 2012
    27 Jan 2011
    Link to this post
    Hi all,

    I'm trying to modify the News template and break the month, day, and year of the publication date into separate divs for styling purposes. Thus far, everything I've tried throws an exception. Is there a way to format the PublicationDate.ToLocal() to only return one part at a time?
  2. Gaston County
    Gaston County avatar
    38 posts
    Registered:
    23 Feb 2012
    27 Jan 2011
    Link to this post
    Figured it out moments after hitting Post.

    <div class="publicationDate">
        <div class="day">
            <sf:FieldListView ID="PublicationDateDay" runat="server" Format="{PublicationDate.ToLocal():dd}" />
        </div>
        <div class="month">
            <sf:FieldListView ID="PublicationDateMonth" runat="server" Format="{PublicationDate.ToLocal():MMM}" />
        </div>
        <div class="year">
            <sf:FieldListView ID="PublicationDateYear" runat="server" Format="{PublicationDate.ToLocal():yyyy}" />
        </div>
    </div>

2 posts, 0 answered