add back to top

This commit is contained in:
xiaomlove
2022-04-04 17:26:26 +08:00
parent 9af8e5e442
commit 325c234442
38 changed files with 686 additions and 498 deletions
+10 -2
View File
@@ -30,7 +30,15 @@ parked();
\Nexus\Nexus::css('vendor/fullcalendar-5.10.2/main.min.css', 'header', true);
\Nexus\Nexus::js('vendor/fullcalendar-5.10.2/main.min.js', 'footer', true);
\Nexus\Nexus::js('vendor/fullcalendar-5.10.2/locales/zh-cn.js', 'footer', true);
$lang = get_langfolder_cookie();
$localesMap = [
'en' => 'en-us',
'chs' => 'zh-cn',
'cht' => 'zh-tw',
];
$localeJs = $localesMap[$lang] ?? 'en-us';
\Nexus\Nexus::js("vendor/fullcalendar-5.10.2/locales/{$localeJs}.js", 'footer', true);
$today = \Carbon\Carbon::today();
$tomorrow = \Carbon\Carbon::tomorrow();
@@ -57,7 +65,7 @@ foreach ($period as $value) {
if ($logValue->is_retroactive) {
$events[] = array_merge($eventBase, ['title' => $lang_attendance['retroactive_event_text'], 'display' => 'list-item']);
}
} else {
} elseif ($value->lte($today) && $value->diffInDays($today) <= \App\Models\Attendance::MAX_RETROACTIVE_DAYS) {
$events[] = array_merge($eventBase, ['groupId' => 'to_do', 'display' => 'list-item']);
}
}