Added timezone for user; Moved dashboard to controller

This commit is contained in:
Constantin Graf
2024-03-19 17:19:54 +01:00
parent 2133eb0c16
commit 6ecfef6bf1
16 changed files with 494 additions and 308 deletions

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace App\Service;
use Carbon\CarbonTimeZone;
use DateTimeZone;
class TimezoneService
{
/**
* @return array<string>
*/
public function getTimezones(): array
{
$tzlist = CarbonTimeZone::listIdentifiers(DateTimeZone::ALL);
return $tzlist;
}
/**
* @return array<string, string>
*/
public function getSelectOptions(): array
{
$tzlist = $this->getTimezones();
$options = [];
foreach ($tzlist as $tz) {
$options[$tz] = $tz;
}
return $options;
}
}