Add a widget to select a movement

This commit is contained in:
2025-05-13 19:29:26 +02:00
parent 3772dce01c
commit 5e4de364e0
9 changed files with 269 additions and 58 deletions

View File

@ -1,5 +1,6 @@
import { DatePicker } from "@mui/x-date-pickers";
import { dateToTime, timeToDate } from "../../utils/DateUtils";
import { TextFieldVariants } from "@mui/material";
export function DateInput(p: {
ref?: React.Ref<HTMLInputElement>;
@ -9,6 +10,7 @@ export function DateInput(p: {
style?: React.CSSProperties;
value: number | undefined;
onValueChange: (v: number | undefined) => void;
variant?: TextFieldVariants;
}): React.ReactElement {
return (
<DatePicker
@ -17,7 +19,7 @@ export function DateInput(p: {
label={p.label}
slotProps={{
field: { ref: p.ref },
textField: { variant: "standard", style: p.style },
textField: { variant: p.variant ?? "standard", style: p.style },
}}
value={timeToDate(p.value)}
onChange={(v) => {