Date selector on grid calendar view is off by a month

Home Forums Calendar Products Events Calendar PRO Date selector on grid calendar view is off by a month

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #13678
    Steve
    Member

    Hi, great plugin. Finally someone made a real event calendar for WP.

    Except for one thing. When you’re looking at the calendar grid view, the name of the month in the dropdown is off by one month. So if I’m looking at my website’s calendar right now (January 2012) it shows December 2011 in the drop-down. Not to worry, here is a fix. Just change this bit of code in /public/template-tags/calendar.php, around line 144:

    function tribe_month_year_dropdowns( $prefix = ” ) {
    global $wp_query;

    if ( isset ( $wp_query->query_vars[‘eventDate’] ) ) {
    // change this line: $date = $wp_query->query_vars[‘eventDate’];
    $date = $wp_query->query_vars[‘eventDate’] . “-01”;

    } else {
    $date = date_i18n( TribeDateUtils::DBDATEFORMAT );
    }
    $monthOptions = TribeEventsViewHelpers::getMonthOptions( $date );
    $yearOptions = TribeEventsViewHelpers::getYearOptions( $date );
    include(TribeEvents::instance()->pluginPath.’admin-views/datepicker.php’);
    }

    #13732
    Rob
    Member

    This suggestion here is awesome, Steve – thank you. We’ve had a few users report this issue so far, and though I’ve been unable to recreate it on my end, your fix will definitely be of value to others who come with the same problem down the road. Thanks again.

    #13895
    Emmett
    Member

    Steve, I just found this solution – thank you for taking the time to share your fix. Unfortunately, I can’t find the /public/template-tags/calendar.php you are referring to. Can you give me bit more direction? It this in the Events Calendar Pro plug-in folder? Thanks again!

    #13968
    Rob
    Member

    Hey Emmett. That file would actually be in the folder for the free The Events Calendar; since PRO is an add-on that extends the functionality of free, a lot of the core stuff is in that free Events Calendar folder. Hope this helps – let me know if you’ve still got questions on it.

    #14217
    Dave Meyer
    Participant

    That fixed it for me. Steve and Rob, I really appreciate your help.

    #14228
    Rob
    Member

    Happy to help (for what little I did). Steve’s the man.

    Dave, let us know if you need anything else in the future!

    #14833
    David
    Participant

    This didn’t seem to fix it for me. I see what you did and that should have been the fix, but it’s not working for me. Also my tribe_get_current_month_text(); is a month behind.

    Any ideas?

    #14834
    David
    Participant

    Wait, seems to work now…Odd.

    #14840
    Rob
    Member

    Great to hear that did it, David – if for some reason the problem arises again let me know and we’ll try and assist as best we can.

    #18233
    Carlos
    Participant

    good fix Steve! thxs!

    #18332
    Rob
    Member

    Heck yeah. Thanks for confirming that did the trick, Carlos.

    #18534
    Spoa
    Member

    I found this post because I am having this problem as well and it appears that the change suggested here is already in place. Any other ideas as to what could cause this issue? I’m running v2.0.6 on WP 3.2.1.

    #18590
    Spoa
    Member

    Nevermind…it turns out I misinterpreted the comment. It’s working correctly now.

    #18617
    Jonah
    Participant

    Glad to hear Spoa, let us know if there’s anything else we can help out with here.

    #976711
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Date selector on grid calendar view is off by a month’ is closed to new replies.