feat: include optional time in transportation service

addresses #86996x46z
This commit is contained in:
Björn Fromme
2025-06-02 14:58:48 +02:00
parent 2e602b85b2
commit 7bfa5f5ed7
5 changed files with 70 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\BusProNet\Utility;
class DayTimeUtility
{
public function mapTime(?string $time): ?string
{
if (null === $time) {
return null;
} elseif ($time >= '00:00' && $time <= '05:59') {
return 'nachts';
} elseif ($time >= '06:00' && $time <= '11:59') {
return 'morgens';
} elseif ($time >= '12:00' && $time <= '14:59') {
return 'mittags';
} elseif ($time >= '15:00' && $time <= '19:59') {
return 'abends';
} elseif ($time >= '20:00' && $time <= '23:59') {
return 'nachts';
} else {
return null;
}
}
}