DX: Add rolling date converter + unit test

This commit is contained in:
2022-11-07 17:42:00 +01:00
parent 5489178e4b
commit c7f740d5d7
3 changed files with 243 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ class RollingDate
* @param DateTimeImmutable|null $pivotDate Will be "now" if null is given
* @param DateTimeImmutable|null $fixedDate Only to insert if $roll equals @see{self::T_FIXED_DATE}
*/
public function __construct(string $roll, ?DateTimeImmutable $pivotDate = null, ?DateTimeImmutable $fixedDate = null)
public function __construct(string $roll, ?DateTimeImmutable $fixedDate = null, ?DateTimeImmutable $pivotDate = null)
{
$this->roll = $roll;
$this->pivotDate = $pivotDate ?? new DateTimeImmutable('now');