Add weekly department results route, enhance date handling in invoicing and statistics logic, and improve Slack notification configuration

This commit is contained in:
Jeppe Bundgaard
2026-03-11 10:52:49 +01:00
parent 4945abfd8e
commit 15a7a7b8a5
4 changed files with 122 additions and 14 deletions
@@ -62,7 +62,11 @@ class InvoicingPeriodRoute
self::requireDateFormat($dateFrom, 'Y-m-d');
self::requireDateFormat($dateTo, 'Y-m-d');
// Add a day to the dateTo parameter to include the end date in the range
$dateTo = date('Y-m-d', strtotime($dateTo . ' +1 day'));
$dateFrom = date('Y-m-d 00:00:00', strtotime($dateFrom));
$dateTo = date('Y-m-d 23:59:59', strtotime($dateTo));
// Add date from and date to to the response meta
$response->add_meta('date_from', $dateFrom);
$response->add_meta('date_to', $dateTo);
// Get the invoicing period for the user
$response->success([...self::getInvoicingPeriod($dateFrom, $dateTo)]);
} else {