WordPress.org

Ready to get started?Download WordPress

Forums

My Calendar
[resolved] Widget {date} option (9 posts)

  1. aasrithg
    Member
    Posted 1 year ago #

    I want to use only the month or day and not the entire {date} in my widget for the calendar. Can anyone please help me out?

    http://wordpress.org/extend/plugins/my-calendar/

  2. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    Use {date format="M, d"} (or your choice of date formatting) to customize the date. All date template tags can take custom formatting.

  3. aasrithg
    Member
    Posted 1 year ago #

    Thank for that. But when I use the code like

    <span> {date format="F"} </span> for month
    <span> {date format="d"} </span> for day

    the month appears correctly but my date gets messed up and {date format ="d"} is printed on the screen

  4. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    How are you using the code? Can you provide an exact sample from your template?

  5. aasrithg
    Member
    Posted 1 year ago #

    My code in the widget is as foolows:

    <div id="events">
    <div class="item">
    
    <span class="month">{date format="F"}</span>
    
    <div class="event-date">
    <span class ="day">{date}</span></div>
    <h4>{link_title}</h4>
    <p class="time">From {time} until:{endusertime},{category}</p>
    </div>
    </div>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  6. aasrithg
    Member
    Posted 1 year ago #

    In the second {date} in the above code the display gets messed up and does not get parsed. I want to display the month in one line and the day in the other.

  7. aasrithg
    Member
    Posted 1 year ago #

    <div id="events">
    <div class="item">
    
    <span class="month">{date format="F"}</span>
    
    <div class="event-date">
    <span class ="day">{date}</span></div>
    <h4>{link_title}</h4>
    <p class="time">From {time} until:{endusertime},{category}</p>
    </div>
    </div>

    this was my code for implementation

  8. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    Interesting. Each template item is only parsed once. However, there are multiple date template options - I recommend using {dtstart format="F"} and {date}, respectively.

    For the record, {date} only includes the base date information; {dtstart} contains a full timestamp including the date and time information.

  9. aasrithg
    Member
    Posted 1 year ago #

    It worked thank you my widget looks the way I wanted it to.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic