Skip to content
Snippets Groups Projects
Commit b7688ce4 authored by Uma's avatar Uma
Browse files

Merge branch 'redundant_date_comparison' into 'master'

Fixes #1263 Redundant date comparsion has been alterted for datetime fields

See merge request !574
parents a7f92895 1522b48e
No related branches found
No related tags found
No related merge requests found
......@@ -367,14 +367,27 @@ class WorkFlowScheduler {
$value = date('Y-m-d', strtotime('-1 days'));
break;
case 'less than days later' :
case 'less than days later' :
$days = $condition['value']+1;
$value = date('Y-m-d', strtotime('-1 day')).','.date('Y-m-d', strtotime('+'.$days.' days'));
if($fieldType[0] == 'D'){
  • Author Owner

    @manuelgit Thanks! for the catch addressed here

  • Please register or sign in to reply
$value = date('Y-m-d').','.date('Y-m-d', strtotime('+'.$days.' days'));
}else if($fieldType[0] == 'DT'){
$value = date('Y-m-d', strtotime('-1 day')).','.date('Y-m-d', strtotime('+'.$days.' days'));
$startDate = date('Y-m-d').' '.'00:00:00';
$endDate = date('Y-m-d',strtotime('+'.$days.' days')).' '.'23:59:59';
$value = $startDate.','.$endDate;
}else{
$value = date('Y-m-d', strtotime('-1 day')).','.date('Y-m-d', strtotime('+'.$days.' days'));
}
break;
case 'more than days later' :
$days = $condition['value']-1;
$value = date('Y-m-d', strtotime('+'.$days.' days'));
$days = $condition['value']-1;
if($fieldType[0] == 'DT'){
$value = date('Y-m-d', strtotime('+'.$days.' days')).' '.'23:59:59';
}else{
$value = date('Y-m-d', strtotime('+'.$days.' days'));
}
break;
}
@date_default_timezone_set($default_timezone);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment