mirror of https://github.com/ekimekim/wubloader
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
634 B
TypeScript
24 lines
634 B
TypeScript
import { Component, createSignal, onMount } from "solid-js";
|
|
import { DateTime } from "../external/luxon.min";
|
|
import Clock from "./Clock";
|
|
import TimeConverter from "./TimeConverter";
|
|
|
|
const Utilities: Component = () => {
|
|
const [busStartTime, setBusStartTime] = createSignal<DateTime | null>(null);
|
|
|
|
onMount(async () => {
|
|
const dataResponse = await fetch("/thrimshim/defaults");
|
|
const data = await dataResponse.json();
|
|
setBusStartTime(DateTime.fromISO(data.bustime_start));
|
|
});
|
|
|
|
return (
|
|
<>
|
|
<Clock busStartTime={busStartTime} />
|
|
<TimeConverter busStartTime={busStartTime} />
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default Utilities;
|