How i can restric the date selection to only current month and next month

Home Forums Calendar Products Events Calendar PRO How i can restric the date selection to only current month and next month

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #41984
    Stephen
    Participant

    Hi

    How i can restric the date selection to only current month and next month . looking forward for help
    Thanks

    #42006
    Stephen
    Participant

    Rather to open selection of previous years/month and future months/years i just only want to restrict current month and next month

    #42067
    Jonah
    Participant

    Hi Stephen, you could do this by simply hiding or removing the month/year drop downs and nav. To hide, simply add the following CSS to your theme’s style.css file:

    .tribe-events-month-nav {
    display: none;
    }

    To remove, make a copy of /wp-content/plugins/the-events-calendar/views/gridview.php and place in an ‘events’ folder in your theme. Then open it up and remove lines 17-31.

    I hope that helps but let me know if you need anything else.

    – Jonah

    #42100
    Stephen
    Participant

    Hi Jonah,

    Thanks a lot but by following your answer it will be totally hide and there will no selection will be available by doing this. Rather to that i need only current month and next month to select so visitor can view events for 2 months only..
    Is this help in any way
    $( “#datepicker” ).datepicker({ minDate: -20, maxDate: “+1M +10D” });

    Thanks

    #42105
    Stephen
    Participant

    Ok I have solved this puzzle my self…. just its hard to find which file needs editing…

    File name: tribe-view-helpers.class.php
    code need to add

    if ($englishMonth == $currentMonth || $nextMonth == $englishMonth ) {
    $options .= "$monthText\n";
    }
    $monthIndex++;

    Now just current and next month available to select by visitor to view events…. Cheers
    thanks

    #42204
    Jonah
    Participant

    Hi Stephen,

    It’s not recommended to edit core files because your changes will be lost the next time you update. What line(s) are you modifying in the files? I can at least offer adding an internal ticket to add a filter for this so you can make changes safely.

    Regards,
    – Jonah

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How i can restric the date selection to only current month and next month’ is closed to new replies.