fix: rental booking buffer applied to end times + phone mask
- getMaxEndHour now subtracts breakHours from next booking's start, so you can't book right up to a slot that needs buffer time before it - effectiveStartHour moved before availableEndHours so equal start/end times are no longer possible - maskPhone (+7 (XXX) XXX-XX-XX) applied to phone field in RentalBookingModal Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -108,7 +108,7 @@ export function BookingModal({ open, draft, rooms, bookings = [], onClose, onSav
|
||||
const rentalGetMaxEnd = (start: number) => {
|
||||
const next = rentalDayBookings.filter(b => !b.isFullDay && b.startHour >= start + 1)
|
||||
.sort((a, b) => a.startHour - b.startHour)[0]
|
||||
return next ? next.startHour : (rentalObj?.closeHour ?? 22)
|
||||
return next ? next.startHour - rentalBreakH : (rentalObj?.closeHour ?? 22)
|
||||
}
|
||||
const rentalEffStart = rentalAvailStarts.includes(rentalStartH) ? rentalStartH : (rentalAvailStarts[0] ?? rentalObj?.openHour ?? 8)
|
||||
const rentalAvailEnds = rentalHourOptions(rentalEffStart + 1, rentalGetMaxEnd(rentalEffStart))
|
||||
|
||||
Reference in New Issue
Block a user