diff --git a/module/metric/calc/system/scale/count_of_changed_story.php b/module/metric/calc/system/scale/count_of_changed_story.php index ef89d3546e..a252ed7afc 100644 --- a/module/metric/calc/system/scale/count_of_changed_story.php +++ b/module/metric/calc/system/scale/count_of_changed_story.php @@ -30,7 +30,12 @@ class count_of_changed_story extends baseCalc { if(empty($row->changedDate) || $row->status == 'changing' || $row->status == 'reviewing') return false; - if(!empty($row->executionStartDate) && !empty($row->executionEndDate) && $row->changedDate < $row->executionStartDate || $row->changedDate > $row->executionEndDate) return false; + $executionStartDate = new DateTime($row->executionStartDate); + $executionEndDate = new DateTime($row->executionEndDate); + $executionStartDate = $executionStartDate->modify('-1 day'); + $executionEndDate = $executionEndDate->modify('+1 day'); + $changedDate = new DateTime($row->changedDate); + if(!empty($row->executionStartDate) && !empty($row->executionEndDate) && ($changedDate < $executionStartDate || $changedDate > $executionEndDate)) return false; $this->result ++; } diff --git a/module/metric/calc/system/scale/scale_of_changed_story.php b/module/metric/calc/system/scale/scale_of_changed_story.php index 4d176f3996..8b337888ff 100644 --- a/module/metric/calc/system/scale/scale_of_changed_story.php +++ b/module/metric/calc/system/scale/scale_of_changed_story.php @@ -31,8 +31,13 @@ class scale_of_changed_story extends baseCalc if($row->isParent == '1') return false; if(empty($row->estimate)) return false; + $executionStartDate = new DateTime($row->executionStartDate); + $executionEndDate = new DateTime($row->executionEndDate); + $executionStartDate = $executionStartDate->modify('-1 day'); + $executionEndDate = $executionEndDate->modify('+1 day'); + $changedDate = new DateTime($row->changedDate); if(empty($row->changedDate) || $row->status == 'changing' || $row->status == 'reviewing') return false; - if(!empty($row->executionStartDate) && !empty($row->executionEndDate) && $row->changedDate < $row->executionStartDate || $row->changedDate > $row->executionEndDate) return false; + if(!empty($row->executionStartDate) && !empty($row->executionEndDate) && ($changedDate < $executionStartDate || $changedDate > $executionEndDate)) return false; $this->result += $row->estimate; }