WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Event Calendar 3] Date Format on Event List (6 posts)

  1. peterson40
    Member
    Posted 5 years ago #

    Is there anyway to change the date format on the sidebar widget Event List? I would like to change it from "26 October" to "October 26" or "10/26". Also, it list the date above the event. Can that be changed to be on the same line. So essesntially I want to change it from this:

    26 October
    My Event (3:00p)
    27 October
    My Event 2 (3:00p)

    to this:

    10/26 :: My Event (3:00p)
    10/27 :: My Event 2 (3:00p)

  2. thornomad
    Member
    Posted 5 years ago #

    Hi -

    Currently, there isn't an easy way to do this without either: [1] modify the widget plugin or [2] create your own customized theme template.

    I think the first option will probably be easier -- if you go into your event-calendar plugin folder and open the file widget.php and go to around line 108 you should see code that says:

    echo $before_widget . $before_title;
    echo ec3_default_string($options['title'],'Upcoming Events');
    echo $after_title;
    ec3_get_events($options['limit']);
    echo $after_widget;

    Change it to:

    echo $before_widget . $before_title;
    echo ec3_default_string($options['title'],'Upcoming Events');
    echo $after_title;
    ec3_get_events($options['limit'],'%DATE%: <a href="%LINK%">%TITLE%</a> (%TIME%)','','m/j');
    echo $after_widget;

    You can read more about customizing the ec3_get_events() function at: http://wpcal.firetree.net/template-functions/ec3_get_events/

    We should add that to the widget plugin -- is nice functionality.

    Damon

  3. peterson40
    Member
    Posted 5 years ago #

    That did it! Thanks a bunch. I have tried every event plugin on wordpress and this is by far the best one. Thanks for your help!

  4. alex_tingle
    Member
    Posted 5 years ago #

    You shouldn't need to edit any code. Event Calendar just uses the blog-wide date format. You should just be able to change your date format on WordPress' main settings page.

    If that doesn't work, then it's a bug. Come over the the mailing list and help us fix it.

  5. alex_tingle
    Member
    Posted 5 years ago #

    Ah, actually you are right, it *does* ignore the WP date format by default. I'll fix it.

  6. Andy-long
    Member
    Posted 5 years ago #

    Has anyone got anywhere with this issue I am trying to change the format in the widget to dd/mm/yy with no look so far. Andy Help would be good even if you just point me in the right direction.

    thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Topic