fixing time in step 2 order tanggal
This commit is contained in:
parent
aa442f33f6
commit
12c0f3ec92
@ -746,8 +746,6 @@ function validateCartBeforeSubmit() {
|
|||||||
cart.forEach((item, index) => {
|
cart.forEach((item, index) => {
|
||||||
const pesananList = item.pesanan || [];
|
const pesananList = item.pesanan || [];
|
||||||
pesananList.forEach((pesanan, i) => {
|
pesananList.forEach((pesanan, i) => {
|
||||||
console.log(!pesanan.karbohidrat_id, !item?.apakah_someday);
|
|
||||||
|
|
||||||
if (!pesanan.tgl) {
|
if (!pesanan.tgl) {
|
||||||
isValid = false;
|
isValid = false;
|
||||||
errorMessage = `Tanggal belum diisi pada item "${item.nama_menu}" (baris ${i + 1})`;
|
errorMessage = `Tanggal belum diisi pada item "${item.nama_menu}" (baris ${i + 1})`;
|
||||||
@ -837,12 +835,13 @@ function initFlatpickrTersedia(item, i) {
|
|||||||
dayNumbers.forEach(day => {
|
dayNumbers.forEach(day => {
|
||||||
const dayStr = String(day).padStart(2, '0');
|
const dayStr = String(day).padStart(2, '0');
|
||||||
const fullDateStr = `${year}-${month}-${dayStr}`;
|
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
|
// Jika bukan menu someday, cek aturan H-1 dan jam batas
|
||||||
if (item.apakah_someday) {
|
if (item.apakah_someday) {
|
||||||
availableDates.push(fullDateStr);
|
availableDates.push(fullDateStr);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
const selisihHari = Math.floor((fullDate - now) / (1000 * 60 * 60 * 24));
|
const selisihHari = Math.floor((fullDate - now) / (1000 * 60 * 60 * 24));
|
||||||
if (selisihHari >= 1 || (selisihHari === 1 && !lewatBatasNormal)) {
|
if (selisihHari >= 1 || (selisihHari === 1 && !lewatBatasNormal)) {
|
||||||
availableDates.push(fullDateStr);
|
availableDates.push(fullDateStr);
|
||||||
@ -884,7 +883,6 @@ function increment(itemId, index) {
|
|||||||
function decrement(itemId, index) {
|
function decrement(itemId, index) {
|
||||||
const input = document.getElementById(`jumlah-${itemId}-${index}`);
|
const input = document.getElementById(`jumlah-${itemId}-${index}`);
|
||||||
let current = parseInt(input.value || "0");
|
let current = parseInt(input.value || "0");
|
||||||
console.log(current);
|
|
||||||
|
|
||||||
if (current > 1) {
|
if (current > 1) {
|
||||||
input.value = current - 1;
|
input.value = current - 1;
|
||||||
@ -960,7 +958,6 @@ document.getElementById('submitNote').addEventListener('click', function(e){
|
|||||||
const noted = $("#note_order").val()
|
const noted = $("#note_order").val()
|
||||||
const cart = JSON.parse(sessionStorage.getItem('cart') || '[]');
|
const cart = JSON.parse(sessionStorage.getItem('cart') || '[]');
|
||||||
const item =cart.find(item => item.id === id)
|
const item =cart.find(item => item.id === id)
|
||||||
console.log(id, index, item);
|
|
||||||
|
|
||||||
if(item && item.pesanan && item.pesanan[index]){
|
if(item && item.pesanan && item.pesanan[index]){
|
||||||
item.pesanan[index].catatan = noted
|
item.pesanan[index].catatan = noted
|
||||||
|
|||||||
@ -82,7 +82,7 @@
|
|||||||
<option value="Ruang Cempaka">Ruang Cempaka</option>
|
<option value="Ruang Cempaka">Ruang Cempaka</option>
|
||||||
<option value="Ruang Widuri">Ruang Widuri</option>
|
<option value="Ruang Widuri">Ruang Widuri</option>
|
||||||
<option value="Ruang Teratai">Ruang Teratai</option>
|
<option value="Ruang Teratai">Ruang Teratai</option>
|
||||||
<option value="Klinik Anggrek">Klinik Melati</option>
|
<option value="Klinik Anggrek">Klinik Anggrek</option>
|
||||||
<option value="Ruang VK">Ruang VK</option>
|
<option value="Ruang VK">Ruang VK</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -99,7 +99,7 @@
|
|||||||
<option value="VIP A">VIP A</option>
|
<option value="VIP A">VIP A</option>
|
||||||
<option value="VIP B">VIP B</option>
|
<option value="VIP B">VIP B</option>
|
||||||
<option value="Kelas I">Kelas I</option>
|
<option value="Kelas I">Kelas I</option>
|
||||||
<option value="Mesa Tesa">Mesa Tesa</option>
|
<option value="Klinik Melati">Klinik Melati</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
{{-- End Pasien --}}
|
{{-- End Pasien --}}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user