feat: include optional time in transportation service
addresses #86996x46z
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user