feat: add the booking board with floor plan and calendar

This commit is contained in:
fromme committed 2026-09-13 15:18:20 +02:00
1 parent f4741e1bee
commit 59feca2f8e
22 files changed
+1015 -17

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace App\Booking;
/**
* The Y-m-d day identifier that every board route speaks.
*/
final class DateParam
{
/** Route requirement, so a malformed day 404s instead of silently falling back to today. */
public const PATTERN = '\d{4}-\d{2}-\d{2}';
public static function parse(?string $value): ?\DateTimeImmutable
{
if (null === $value || '' === $value) {
return null;
}
// The leading "!" resets the time part, so the result is midnight rather than "now".
$date = \DateTimeImmutable::createFromFormat('!Y-m-d', $value);
return false === $date ? null : $date;
}
public static function parseOrToday(?string $value): \DateTimeImmutable
{
return self::parse($value) ?? new \DateTimeImmutable('today');
}
}