const date = '2026-06-11';
const slots = ['09:00', '10:00', '11:00', '12:00'];
const bookedSlots = [];

const today = new Date();
const todayStr = today.toISOString().split('T')[0];
const isToday = date === todayStr;
const currentHour = today.getHours();
const currentMinute = today.getMinutes();

console.log("todayStr:", todayStr);
console.log("date:", date);
console.log("isToday:", isToday);
console.log("currentHour:", currentHour);
console.log("currentMinute:", currentMinute);

const processedSlots = slots.map(time => {
  let isPast = false;
  if (isToday) {
    const [h, m] = time.split(':').map(Number);
    if (h < currentHour || (h === currentHour && m <= currentMinute)) {
      isPast = true;
    }
  }
  
  const isBooked = bookedSlots.includes(time) || isPast;
  return { time, isBooked };
});

console.log(processedSlots);
