{{-- resources/views/components/calendar.blade.php --}} @props(['id', 'editValue' => null, 'dbAlreadyFlexible' => null, 'name', 'dmenu', 'holidays', 'bookings', 'rooms', 'inputRoomId', 'thisBookingStatus' => 'pending', 'formGotAnyError' => false, 'detailedPopover' => false]) @php // Inisialisasi variabel kosong $invalidMessages = null; $invalidDateArr = null; $holidayArr = null; $bookingArr = null; $roomArr = null; // dd($defaultValue); $defaultValue = ''; if (old($name)) { $defaultValue = old($name); } if (!(old($name)) && $editValue && is_string($editValue)) { $defaultValue = str_replace(""", "\"", $editValue); } // Mendapatkan daftar hari libur $currentDate = new DateTime; $currentYear = $currentDate->format('Y'); $startOfLastYear = new DateTime("first day of January $currentYear -1 year"); $endOfNextYear = new DateTime("last day of December $currentYear +1 year"); if ($holidays && is_string($holidays)) { $holidayArr = str_replace(""", "\"", $holidays); } if ($bookings && is_string($bookings)) { $bookingArr = str_replace(""", "\"", $bookings); } if ($rooms && is_string($rooms)) { $roomArr = str_replace(""", "\"", $rooms); } // dd($holidayArr, $bookingArr); @endphp {{--