This commit is contained in:
salam committed 2026-10-04 15:25:03 +02:00
1 parent 9bcd4432c6
commit 6f92f9e1d5
1209 files changed
+220940

No files matched your search

@@ -0,0 +1,32 @@
<?php
namespace App\Filament\Pages\Selections;
use Carbon\CarbonPeriod;
use Illuminate\Support\Carbon;
class LoadSeasons
{
public static function load($seasonmode)
{
if (!$seasonmode) {
return [];
}
$season = [];
$period = CarbonPeriod::create(Carbon::now()->year(2024), '1 year', Carbon::now());
foreach ($period as $date) {
if ($seasonmode == 'halfyear') {
if ((int) date('m') > 7)
$tmp = $date->format('y') . '/' . $date->format('y') + 1;
else
$tmp = $date->format('y') - 1 . '/' . $date->format('y');
$season[$tmp] = $tmp;
} else {
$season[(string) $date->year] = (string) $date->year;
}
}
return $season;
}
}