修复订单显示bug

This commit is contained in:
2026-06-10 20:20:47 +08:00
parent de62513987
commit 9fbc6f8cd1
45 changed files with 7514 additions and 2025 deletions

View File

@@ -170,11 +170,19 @@ export function buildCustomSlots(selectedDateKey: string, now: Date): Array<Book
const minStartTime = now.getTime() + MIN_ADVANCE_MINUTES * 60 * 1000
for (let h = 0; h < 24; h++) {
for (let h = 8; h < 20; h++) {
for (let m = 0; m < 60; m += CUSTOM_SLOT_STEP_MINUTES) {
const startDate = new Date(parsed.year, parsed.month, parsed.day, h, m, 0, 0)
const endDate = new Date(parsed.year, parsed.month, parsed.day, h, m + CUSTOM_SLOT_DURATION_MINUTES, 0, 0)
// 禁止跨天或超出 20:00 的区间
if (endDate.getDate() != startDate.getDate()) {
continue
}
if (endDate.getHours() > 20 || (endDate.getHours() == 20 && endDate.getMinutes() > 0)) {
continue
}
const startAt = startDate.getTime()
const endAt = endDate.getTime()
const available = startAt >= minStartTime
@@ -264,5 +272,9 @@ export function formatStandardAppointmentTime(
if (day == null || slot == null) {
return ''
}
return new Date(slot.startAt).toISOString()
const d = new Date(day.timestamp)
const year = d.getFullYear()
const month = padLeft(d.getMonth() + 1, 2)
const dayNum = padLeft(d.getDate(), 2)
return year + '-' + month + '-' + dayNum + ' ' + slot.label
}