Skip to content

Commit

Permalink
Fix for start date end date issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Bašić committed Oct 21, 2018
1 parent 30bf254 commit a23809e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Traits/Reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public function getHoursLoggedFor($startDate, $endDate, $project = null, $branch
*/
public function getHoursLoggedForLast($period, $project = null, $branches = null)
{
$todayDate = date('m/d/Y');
$endDate = date_format(date_sub(date_create($todayDate), date_interval_create_from_date_string($period)), 'm/d/Y');
$endDate = date('m/d/Y');
$startDate = date_format(date_sub(date_create($todayDate), date_interval_create_from_date_string($period)), 'm/d/Y');

return $this->getHoursLoggedFor($todayDate, $endDate, $project, $branches);
return $this->getHoursLoggedFor($startDate, $endDate, $project, $branches);
}

/**
Expand Down Expand Up @@ -100,8 +100,8 @@ public function getHoursLoggedForLast30Days($project = null, $branches = null)
*/
public function getHoursLoggedForThisMonth($project = null, $branches = null)
{
$endDate = date('m/01/Y');
$startDate = date('m/d/Y');
$startDate = date('m/01/Y');
$endDate = date('m/d/Y');

return $this->getHoursLoggedFor($startDate, $endDate, $project, $branches);
}
Expand All @@ -116,8 +116,8 @@ public function getHoursLoggedForThisMonth($project = null, $branches = null)
*/
public function getHoursLoggedForLastMonth($project = null, $branches = null)
{
$endDate = date_format(date_sub(date_create(), date_interval_create_from_date_string('1 month')), 'm/01/Y');
$startDate = date_format(date_sub(date_create(), date_interval_create_from_date_string('1 month')), 'm/t/Y');
$startDate = date_format(date_sub(date_create(), date_interval_create_from_date_string('1 month')), 'm/01/Y');
$endDate = date_format(date_sub(date_create(), date_interval_create_from_date_string('1 month')), 'm/t/Y');

return $this->getHoursLoggedFor($startDate, $endDate, $project, $branches);
}
Expand Down

0 comments on commit a23809e

Please sign in to comment.