fix: show date fields in report snapshots using native date inputs

This commit is contained in:
2026-06-12 16:39:40 +05:30
parent d58f2a0744
commit 0907e071b5

View File

@@ -15,6 +15,7 @@ import {
DialogContentText, DialogContentText,
DialogActions, DialogActions,
Chip, Chip,
TextField,
} from "@mui/material"; } from "@mui/material";
import DeleteIcon from "@mui/icons-material/Delete"; import DeleteIcon from "@mui/icons-material/Delete";
import AddCircleIcon from "@mui/icons-material/AddCircle"; import AddCircleIcon from "@mui/icons-material/AddCircle";
@@ -131,28 +132,30 @@ export default function ReportSnapshots() {
/> />
)} )}
<Box sx={{ display: "flex", gap: 2 }}> <Box sx={{ display: "flex", gap: 2 }}>
{startDateField && components?.date && (
<Box sx={{ flex: 1 }}> <Box sx={{ flex: 1 }}>
<components.date <TextField
name="start_date" label="Start Date"
field={startDateField} type="date"
value={startDate} value={startDate}
onChange={(val: string) => setStartDate(val)} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setStartDate(e.target.value)}
size="small"
InputLabelProps={{ shrink: true }}
inputProps={{ max: new Date().toISOString().split("T")[0] }}
/> />
</Box> </Box>
)}
{endDateField && components?.date && (
<Box sx={{ flex: 1 }}> <Box sx={{ flex: 1 }}>
<components.date <TextField
name="end_date" label="End Date"
field={endDateField} type="date"
value={endDate} value={endDate}
onChange={(val: string) => setEndDate(val)} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setEndDate(e.target.value)}
size="small"
InputLabelProps={{ shrink: true }}
inputProps={{ max: new Date().toISOString().split("T")[0] }}
/> />
</Box> </Box>
)} </Box>
</Box>
<Box sx={{ display: "flex", gap: 2 }}> <Box sx={{ display: "flex", gap: 2 }}>
{minAmountField && components?.FormField && ( {minAmountField && components?.FormField && (