diff --git a/public/js/checkout/index.js b/public/js/checkout/index.js index 3ab5dc3..b0ce021 100644 --- a/public/js/checkout/index.js +++ b/public/js/checkout/index.js @@ -746,8 +746,6 @@ function validateCartBeforeSubmit() { cart.forEach((item, index) => { const pesananList = item.pesanan || []; pesananList.forEach((pesanan, i) => { - console.log(!pesanan.karbohidrat_id, !item?.apakah_someday); - if (!pesanan.tgl) { isValid = false; errorMessage = `Tanggal belum diisi pada item "${item.nama_menu}" (baris ${i + 1})`; @@ -837,12 +835,13 @@ function initFlatpickrTersedia(item, i) { dayNumbers.forEach(day => { const dayStr = String(day).padStart(2, '0'); const fullDateStr = `${year}-${month}-${dayStr}`; - const fullDate = new Date(`${fullDateStr}T00:00:00`); - + const fullDate = new Date(`${fullDateStr}T13:00:00`); + // Jika bukan menu someday, cek aturan H-1 dan jam batas if (item.apakah_someday) { availableDates.push(fullDateStr); } else { + const selisihHari = Math.floor((fullDate - now) / (1000 * 60 * 60 * 24)); if (selisihHari >= 1 || (selisihHari === 1 && !lewatBatasNormal)) { availableDates.push(fullDateStr); @@ -884,7 +883,6 @@ function increment(itemId, index) { function decrement(itemId, index) { const input = document.getElementById(`jumlah-${itemId}-${index}`); let current = parseInt(input.value || "0"); - console.log(current); if (current > 1) { input.value = current - 1; @@ -960,7 +958,6 @@ document.getElementById('submitNote').addEventListener('click', function(e){ const noted = $("#note_order").val() const cart = JSON.parse(sessionStorage.getItem('cart') || '[]'); const item =cart.find(item => item.id === id) - console.log(id, index, item); if(item && item.pesanan && item.pesanan[index]){ item.pesanan[index].catatan = noted diff --git a/resources/views/guest/checkout/step/step1.blade.php b/resources/views/guest/checkout/step/step1.blade.php index bc788bd..d026ea4 100644 --- a/resources/views/guest/checkout/step/step1.blade.php +++ b/resources/views/guest/checkout/step/step1.blade.php @@ -82,7 +82,7 @@ - + @@ -99,7 +99,7 @@ - + {{-- End Pasien --}}