Handle negative amount input

This commit is contained in:
2025-04-21 16:04:08 +02:00
parent 09e44da46e
commit 3fe3e20f51
2 changed files with 15 additions and 5 deletions

View File

@ -2,6 +2,7 @@ import { DatePicker } from "@mui/x-date-pickers";
import { dateToTime, timeToDate } from "../../utils/DateUtils";
export function DateInput(p: {
ref?: React.Ref<HTMLInputElement>;
editable?: boolean;
autoFocus?: boolean;
label?: string;
@ -14,7 +15,10 @@ export function DateInput(p: {
autoFocus={p.autoFocus}
readOnly={p.editable === false}
label={p.label}
slotProps={{ textField: { variant: "standard", style: p.style } }}
slotProps={{
field: { ref: p.ref },
textField: { variant: "standard", style: p.style },
}}
value={timeToDate(p.value)}
onChange={(v) => {
try {