diff --git a/TanggalMerah.php b/TanggalMerah.php index 14ebf2d..4a39531 100644 --- a/TanggalMerah.php +++ b/TanggalMerah.php @@ -28,7 +28,7 @@ public function __construct(string $local = null) $this->event = []; $this->date = new DateTime("now", $tz); if (!isset($local)) { - $r = file_get_contents("https://github.com/guangrei/Json-Indonesia-holidays/raw/master/calendar.json"); + $r = file_get_contents("https://raw.githubusercontent.com/guangrei/APIHariLibur_V2/main/calendar.min.json"); $this->data = json_decode($r, true); } else { $r = file_get_contents($local); @@ -61,9 +61,8 @@ public function is_sunday() : bool public function is_holiday() : bool { - $check = isset($this->data[$this->date->format("Ymd")])?true:false; - if ($check) { - $this->event[] = $this->data[$this->date->format("Ymd")]['deskripsi']; + if (isset($this->data[$this->date->format("Y-m-d")]) && $this->data[$this->date->format("Y-m-d")]['holiday']) { + $this->event[] = implode(" | ", $this->data[$this->date->format("Y-m-d")]['summary']); return true; } else { return false;