Files
time_to_leave/src/lib/demo.ts
T
2026-05-09 22:47:17 +02:00

29 lines
935 B
TypeScript

// Demo data for TimeToLeave
import type { Journey, Station } from "@/types";
export const DEMO_STATIONS: Station[] = [
{ name: "Wien Hbf", extId: "0WB0F0001500" },
{ name: "Graz Hbf", extId: "0WB0F0000600" },
{ name: "Salzburg Hbf", extId: "0WB000040000" },
{ name: "Innsbruck Hbf", extId: "0WB000023000" },
{ name: "Linz Hbf", extId: "0WB000031000" },
{ name: "Villach Hbf", extId: "0WB000095000" },
{ name: "Klagenfurt Hbf", extId: "0WB000086000" },
];
export function createDemoJourney(id: string, _station: Station): Journey {
const now = new Date();
return {
id,
sD: new Date(now.getTime() + 30 * 60 * 1000),
rD: new Date(now.getTime() + 30 * 60 * 1000),
sA: new Date(now.getTime() + 90 * 60 * 1000),
rA: new Date(now.getTime() + 90 * 60 * 1000),
delay: 0,
platform: "3",
changes: 0,
trains: [`RJX ${Math.floor(Math.random() * 9000) + 1000}`],
cancelled: false,
};
}