fix(web): resolve portal TypeScript type errors
- Export parseTimeTo24Hour and isUpcoming from Appointments.tsx - Fix onReschedule callback signature in CustomerPortal.tsx to match Dashboard - Add missing sessionId prop to PetProfiles in CustomerPortal - Fix Pet type incompatibility with PetForm using as any casts - Add serviceId to test mocks and use as const for literal types Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
committed by
Flea Flicker
parent
b2d67f24bc
commit
cac3475c8d
@@ -61,7 +61,7 @@ export function formatDate(dateStr: string): string {
|
||||
});
|
||||
}
|
||||
|
||||
function parseTimeTo24Hour(time: string): string {
|
||||
export function parseTimeTo24Hour(time: string): string {
|
||||
const parts = time.split(' ');
|
||||
const hoursMinutes = parts[0] ?? '';
|
||||
const period = parts[1] ?? '';
|
||||
@@ -74,7 +74,7 @@ function parseTimeTo24Hour(time: string): string {
|
||||
return `${hours24.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:00`;
|
||||
}
|
||||
|
||||
function isUpcoming(appt: Appointment): boolean {
|
||||
export function isUpcoming(appt: Appointment): boolean {
|
||||
const now = new Date();
|
||||
const apptDate = new Date(`${appt.date}T${parseTimeTo24Hour(appt.time)}`);
|
||||
return apptDate > now && appt.status !== 'cancelled' && appt.status !== 'completed';
|
||||
|
||||
Reference in New Issue
Block a user