Skip to content

Instantly share code, notes, and snippets.

@nathanielks
Created November 21, 2013 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanielks/7586505 to your computer and use it in GitHub Desktop.
Save nathanielks/7586505 to your computer and use it in GitHub Desktop.
tribe_get_the_day_link bug. Line 16 in old.php was attributing $date_description to 'next day' as opposed to comparing that it was true. It also wasn't feeding date on line 19 a unix timestamp.
<?php
/**
* Get the date for the day navigation link
*
* @param string $date_description
* @return string
* @since 3.1.1
* @throws OverflowException
*/
function tribe_get_the_day_link_date( $date_description ) {
if ( is_null($date_description) ) {
return TribeEventsPro::instance()->todaySlug;
}
if ( $date_description == 'previous day' ) {
return tribe_get_previous_day_date(get_query_var('start_date'));
}
if ( $date_description == 'next day' ) {
return tribe_get_next_day_date(get_query_var('start_date'));
}
return date('Y-m-d', strtotime($date_description) );
}
<?php
/**
* Get the date for the day navigation link
*
* @param string $date_description
* @return string
* @since 3.1.1
* @throws OverflowException
*/
function tribe_get_the_day_link_date( $date_description ) {
if ( is_null($date_description) ) {
return TribeEventsPro::instance()->todaySlug;
}
if ( $date_description == 'previous day' ) {
return tribe_get_previous_day_date(get_query_var('start_date'));
}
if ( $date_description = 'next day' ) {
return tribe_get_next_day_date(get_query_var('start_date'));
}
return date('Y-m-d', $date_description);
}
@stylsdvs
Copy link

stylsdvs commented Dec 7, 2013

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment