feat : ajout d'un écran pour le récap congés et RTT
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
This commit is contained in:
23
src/Util/LeaveRecapCutoff.php
Normal file
23
src/Util/LeaveRecapCutoff.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Util;
|
||||
|
||||
use DateTimeImmutable;
|
||||
|
||||
/**
|
||||
* Leave recap cutoff rule: as-of end of ISO week S-2 (Sunday 23:59:59).
|
||||
*
|
||||
* Example: Tuesday 2026-04-14 (S16) → Sunday 2026-04-05 23:59:59 (end of S14).
|
||||
*/
|
||||
final class LeaveRecapCutoff
|
||||
{
|
||||
public static function resolveCutoff(DateTimeImmutable $today): DateTimeImmutable
|
||||
{
|
||||
$currentWeekMonday = $today->modify('monday this week')->setTime(0, 0);
|
||||
$cutoffWeekMonday = $currentWeekMonday->modify('-14 days');
|
||||
|
||||
return $cutoffWeekMonday->modify('+6 days')->setTime(23, 59, 59);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user