Fix schedule details date format
Upstream /schedule/details returns 400 when dates are sent as yyyy-MM-dd; it wants the full ISO datetime (yyyy-MM-ddT00:00:00), same as Angular's ApiFormatterService.formatDate output. Update the date helper in ScheduleDetailsPage to append T00:00:00. Verified with curl: request now returns 200 with the full flight payload for SU1942 on 2026-04-18.
This commit is contained in:
@@ -31,11 +31,12 @@ export interface ScheduleDetailsPageProps {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert yyyyMMdd to yyyy-MM-dd for the API.
|
||||
* Convert yyyyMMdd to yyyy-MM-ddT00:00:00 for the API (matches Angular's
|
||||
* ApiFormatterService.formatDate).
|
||||
*/
|
||||
function formatApiDate(yyyymmdd: string): string {
|
||||
if (yyyymmdd.length !== 8) return yyyymmdd;
|
||||
return `${yyyymmdd.slice(0, 4)}-${yyyymmdd.slice(4, 6)}-${yyyymmdd.slice(6, 8)}`;
|
||||
return `${yyyymmdd.slice(0, 4)}-${yyyymmdd.slice(4, 6)}-${yyyymmdd.slice(6, 8)}T00:00:00`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user