Remove broken datetimezone parameter
This commit is contained in:
@@ -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' );
|
||||||
|
|||||||
Reference in New Issue
Block a user