Files
KSP-MGA-Planner/dist/main/time/time.js
Krafpy 2cfb9c0066 Refactored the KSPTime classes
There is no longer a `elapsedYDHMS` property.
Instead, a `displayYDHMS` represents the date to actually
dispay (in UT mode). For specific elapsed time calculation,
this is done directly inside `stringYDHMS` on EMT mode, because
this is the only place where it's used.

Some struggle when modifying the departure and arrival
dates has also been modified by making the auto validation
less harsh in `TimeSelector`. Still some annoying
effects on the system time selector.
2022-12-02 22:53:38 +01:00

13 lines
479 B
JavaScript

import { RealKSPTime } from "./realtime.js";
import { BaseKSPTime } from "./basetime.js";
export function KSPTime(date, config) {
switch (config.type) {
case "base":
if (config.daysPerYear === undefined || config.hoursPerDay === undefined)
throw new Error("Missing daysPerYear or hoursPerDay in time config");
return new BaseKSPTime(date, config);
case "real":
return new RealKSPTime(date, config);
}
}