wip
This commit is contained in:
1 parent
e09e42ab41
commit
fc1e1b2832
6 files changed
+200
-115
No files matched your search
@@ -7,9 +7,9 @@ use Illuminate\Support\Carbon;
|
||||
|
||||
class LoadSeasons
|
||||
{
|
||||
public static function load($seasonmode)
|
||||
public static function load(string $seasonmode)
|
||||
{
|
||||
if (!$seasonmode) {
|
||||
if (! $seasonmode) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -17,13 +17,14 @@ class LoadSeasons
|
||||
$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');
|
||||
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;
|
||||
$season[(string) $date->year] = (string) $date->year;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user