Remove broken datetimezone parameter

This commit is contained in:
Brian Miyaji
2017-11-26 23:09:59 +11:00
parent 5b6ac1a0e4
commit ed10e0f147

View File

@@ -47,9 +47,8 @@ abstract class SP_Secondary_Post extends SP_Custom_Post {
} }
public function range( $where = '', $format = 'Y-m-d' ) { public function range( $where = '', $format = 'Y-m-d' ) {
$datetimezone = new DateTimeZone( sp_get_timezone() ); $from = new DateTime( $this->from );
$from = new DateTime( $this->from, $datetimezone ); $to = new DateTime( $this->to );
$to = new DateTime( $this->to, $datetimezone );
$to->modify( '+1 day' ); $to->modify( '+1 day' );
@@ -59,9 +58,8 @@ abstract class SP_Secondary_Post extends SP_Custom_Post {
} }
public function relative( $where = '', $format = 'Y-m-d' ) { public function relative( $where = '', $format = 'Y-m-d' ) {
$datetimezone = new DateTimeZone( sp_get_timezone() ); $from = new DateTime( 'now' );
$from = new DateTime( 'now', $datetimezone ); $to = new DateTime( 'now' );
$to = new DateTime( 'now', $datetimezone );
$from->modify( '-' . abs( (int) $this->past ) . ' day' ); $from->modify( '-' . abs( (int) $this->past ) . ' day' );
$to->modify( '+' . abs( (int) $this->future ) . ' day' ); $to->modify( '+' . abs( (int) $this->future ) . ' day' );