diff options
| author | ilotterytea <iltsu@alright.party> | 2025-03-26 02:07:18 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-03-26 02:07:18 +0500 |
| commit | 4817a5f2e72a29e6f2c7671d5934e78a19184127 (patch) | |
| tree | 288a7aa3220b0e0a96db3d6f3946acad18467457 /holidays.php | |
| parent | 2bc64b4fafaf7977695e6c0a1805156e00049fea (diff) | |
feat: display holidays
Diffstat (limited to 'holidays.php')
| -rw-r--r-- | holidays.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/holidays.php b/holidays.php new file mode 100644 index 0000000..a48868b --- /dev/null +++ b/holidays.php @@ -0,0 +1,19 @@ +<?php +function load_holidays() +{ + $files = glob("../data/*.json"); + $holidays = []; + + foreach ($files as $file) { + $contents = file_get_contents($file); + array_push($holidays, json_decode($contents, true)); + } + + return $holidays; +} + +define("HOLIDAYS", load_holidays()); + +// other constants + +define("CLIENT_REQUIRES_JSON", isset($_SERVER["HTTP_ACCEPT"]) && $_SERVER["HTTP_ACCEPT"] == "application/json");
\ No newline at end of file |
