Skip to content

Commit

Permalink
Update task query created_at condition
Browse files Browse the repository at this point in the history
  • Loading branch information
asaquzzaman committed Dec 10, 2020
1 parent f75f1ad commit 9a3c87b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/Task/Helper/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -1436,11 +1436,13 @@ private function where_completed_at() {
$completed_at_start = !empty( $this->query_params['completed_at_start'] ) ? $this->query_params['completed_at_start'] : false;
$completed_at_between = !isset( $this->query_params['completed_at_between'] ) ? true : pm_is_true( $this->query_params['completed_at_between'] );
$ope_params = !empty( $this->query_params['completed_at_operator'] ) ? $this->query_params['completed_at_operator'] : false;
$ope_params = $this->get_prepare_data( $ope_params );
$ope_params = pm_get_prepare_data( $ope_params );

if ( $completed_at === false ) {
return $this;
}
if ( empty( $ope_params ) ) {
if ( empty( $completed_at ) ) {
return $this;
}
}

if ( $completed_at_start ) {
$com_start_reduce = date('Y-m-d',(strtotime ( '-1 day' , strtotime ( $completed_at_start) ) ));
Expand Down Expand Up @@ -1512,11 +1514,13 @@ private function where_due_date() {
$due_date_start = !empty( $this->query_params['due_date_start'] ) ? $this->query_params['due_date_start'] : false;
$due_date_between = !isset( $this->query_params['due_date_between'] ) ? true : pm_is_true( $this->query_params['due_date_between'] );
$ope_params = !empty( $this->query_params['due_date_operator'] ) ? $this->query_params['due_date_operator'] : false;
$ope_params = $this->get_prepare_data( $ope_params );
$ope_params = pm_get_prepare_data( $ope_params );

if ( $due_date === false ) {
return $this;
}
if ( empty( $ope_params ) ) {
if ( empty( $due_date ) ) {
return $this;
}
}

if ( $due_date_start ) {
$due_start_reduce = date('Y-m-d',(strtotime ( '-1 day' , strtotime ( $due_date_start) ) ));
Expand Down

0 comments on commit 9a3c87b

Please sign in to comment.