Date selector on grid calendar view is off by a month
  • Stranger
    Posts: 2
    Topics: 4
    Steve January 19, 2012

    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’);
    }

  • Gatekeeper
    Posts: 4202
    Topics: 81
    Answers: 467
    Rob January 20, 2012
    Answered ✔

    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.

  • Stranger
    Posts: 4

    Emmett January 23, 2012

    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!

  • Gatekeeper
    Posts: 4202
    Topics: 81
    Answers: 467
    Rob January 24, 2012

    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.

  • Truth Seeker
    Posts: 26
    Topics: 3
    Dave January 26, 2012

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

  • Gatekeeper
    Posts: 4202
    Topics: 81
    Answers: 467
    Rob January 26, 2012

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

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

  • Stranger
    Posts: 9
    Topics: 2
    David February 7, 2012

    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?

  • Stranger
    Posts: 9
    Topics: 2
    David February 7, 2012

    Wait, seems to work now…Odd.

  • Gatekeeper
    Posts: 4202
    Topics: 81
    Answers: 467
    Rob February 7, 2012

    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.

  • Power User
    Posts: 44
    Topics: 12
    Carlos April 24, 2012

    good fix Steve! thxs!

  • Gatekeeper
    Posts: 4202
    Topics: 81
    Answers: 467
    Rob April 26, 2012

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

  • Stranger
    Posts: 6
    Topics: 1
    Spoa May 1, 2012

    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.

  • Stranger
    Posts: 6
    Topics: 1
    Spoa May 2, 2012

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

  • Power User
    Posts: 4021
    Topics: 4
    Answers: 763
    Jonah May 3, 2012

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

  • Viewing 14 posts - 1 through 14 (of 14 total)