Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active January 18, 2019 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cliffordp/a699255635f7266967284005d979a89d to your computer and use it in GitHub Desktop.
Save cliffordp/a699255635f7266967284005d979a89d to your computer and use it in GitHub Desktop.
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';
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment