mirror of
https://github.com/Krafpy/KSP-MGA-Planner.git
synced 2026-01-10 04:06:24 -08:00
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.
13 lines
479 B
JavaScript
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);
|
|
}
|
|
}
|