diff --git a/changelog/BTRIA-2100-missing-timezone-parameter b/changelog/BTRIA-2100-missing-timezone-parameter new file mode 100644 index 0000000000..9ad9d89cd4 --- /dev/null +++ b/changelog/BTRIA-2100-missing-timezone-parameter @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Correct `tribe_get_end_date` to return dates in the correct time zone. [BTRIA-2100] diff --git a/src/functions/template-tags/date.php b/src/functions/template-tags/date.php index 44a1195fa3..57578ed2ec 100755 --- a/src/functions/template-tags/date.php +++ b/src/functions/template-tags/date.php @@ -26,7 +26,7 @@ * * @param string $date String representing the datetime, assumed to be UTC (relevant if timezone conversion is used) * @param bool $display_time If true shows date and time, if false only shows date - * @param string $date_format Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php) + * @param string $date_format Allows date and time formatting using standard php syntax (http://php.net/manual/en/function.date.php). * * @return string */ @@ -128,7 +128,7 @@ function tribe_beginning_of_day( $date = null, $format = 'Y-m-d H:i:s' ) { * @category Events * * @param string $date The date to find the end of the day, defaults to today - * @param string $format Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php) + * @param string $format Allows date and time formatting using standard php syntax (http://php.net/manual/en/function.date.php). * * @return string */ @@ -160,7 +160,7 @@ function tribe_end_of_day( $date = null, $format = 'Y-m-d H:i:s' ) { if ( ! function_exists( 'tribe_get_datetime_separator' ) ) { /** - * Get the datetime saparator from the database option with escaped characters or not ;) + * Get the datetime separator from the database option with escaped characters or not ;) * * @param string $default Default Separator if it's blank on the Database * @param bool $esc If it's going to be used on a `date` function or method it needs to be escaped @@ -189,8 +189,8 @@ function tribe_get_datetime_separator( $default = ' @ ', $esc = false ) { * @category Events * * @param int $event (optional) - * @param string $date_format Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php) - * @param string $timezone Timezone in which to present the date/time (or default behaviour if not set) + * @param string $date_format Allows date and time formatting using standard php syntax (http://php.net/manual/en/function.date.php) + * @param string $timezone Timezone in which to present the date/time (or default behavior if not set) * * @return string|null Time */ @@ -240,8 +240,8 @@ function tribe_get_start_time( $event = null, $date_format = '', $timezone = nul * @category Events * * @param int $event (optional) - * @param string $date_format Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php) - * @param string $timezone Timezone in which to present the date/time (or default behaviour if not set) + * @param string $date_format Allows date and time formatting using standard php syntax (http://php.net/manual/en/function.date.php) + * @param string $timezone Timezone in which to present the date/time (or default behavior if not set) * * @return string|null Time */ @@ -295,8 +295,8 @@ function tribe_get_end_time( $event = null, $date_format = '', $timezone = null * * @param int $event (optional) * @param bool $display_time If true shows date and time, if false only shows date - * @param string $date_format Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php) - * @param string $timezone Deprecated. Timezone in which to present the date/time (or default behaviour if not set) + * @param string $date_format Allows date and time formatting using standard php syntax (http://php.net/manual/en/function.date.php) + * @param string $timezone Deprecated. Timezone in which to present the date/time (or default behavior if not set) * * @return string|null Date */ @@ -361,8 +361,8 @@ function tribe_get_start_date( $event = null, $display_time = true, $date_format * * @param int $event (optional) * @param bool $display_time If true shows date and time, if false only shows date - * @param string $date_format Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php) - * @param string $timezone Deprecated. Timezone in which to present the date/time (or default behaviour if not set) + * @param string $date_format Allows date and time formatting using standard php syntax (http://php.net/manual/en/function.date.php) + * @param string $timezone Deprecated. Timezone in which to present the date/time (or default behavior if not set) * * @return string|null Date */ @@ -391,7 +391,7 @@ function tribe_get_end_date( $event = null, $display_time = true, $date_format = // @todo [BTRIA-584]: Move timezones to Common. if ( class_exists( 'Tribe__Events__Timezones' ) ) { - $end_date = Tribe__Events__Timezones::event_end_timestamp( $event->ID ); + $end_date = Tribe__Events__Timezones::event_end_timestamp( $event->ID, $timezone ); } else { return null; }