booking capacity check for time slots
This commit is contained in:
@@ -35,11 +35,14 @@ const DateSelector: React.FC<DateSelectorProps> = ({
|
||||
date.setDate(today.getDate() + i);
|
||||
const dateString = date.toISOString().split('T')[0] || '';
|
||||
|
||||
// Create date object from the ISO string to avoid timezone issues
|
||||
const displayDate = new Date(dateString + 'T12:00:00.000Z');
|
||||
|
||||
days.push({
|
||||
date: dateString,
|
||||
day: date.getDate(),
|
||||
month: date.toLocaleDateString('en', { month: 'short' }),
|
||||
dayName: date.toLocaleDateString('en', { weekday: 'short' }),
|
||||
day: parseInt(dateString.split('-')[2]),
|
||||
month: displayDate.toLocaleDateString('en', { month: 'short', timeZone: 'UTC' }),
|
||||
dayName: displayDate.toLocaleDateString('en', { weekday: 'short', timeZone: 'UTC' }),
|
||||
available: availableDates.includes(dateString)
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user