cliff
3/28/2018 - 1:17 PM

Filter the minDate and maxDate for The Events Calendar's "Custom Datepicker Start Date" extension. 7 days prior to Today through 1 month for

Filter the minDate and maxDate for The Events Calendar's "Custom Datepicker Start Date" extension. 7 days prior to Today through 1 month forward from today.

<?php
/**
 * Filter the minDate and maxDate for The Events Calendar's "Custom Datepicker
 * Start Date" extension, which requires PHP 5.3+.
 *
 * 7 days prior to Today through 1 month forward from today.
 *
 * @see Tribe__Extension__Custom_Datepicker_Start_Date::get_min_date()
 * @see Tribe__Extension__Custom_Datepicker_Start_Date::get_max_date()
 *
 * @link https://theeventscalendar.com/extensions/custom-datepicker-start-date/
 * @link https://secure.php.net/manual/class.dateinterval.php The format to follow.
 * @link https://gist.github.com/cliffordp/a699255635f7266967284005d979a89d
 */
add_filter( 'tribe_ext_start_datepicker_min_date_interval', function() {
    return 'P7D';
} );
add_filter( 'tribe_ext_start_datepicker_max_date_interval', function() {
    return 'P1M';
} );