hotfix for the date select used by the exports to allow you to select the start and end dates again
This commit is contained in:
parent
9130e0a627
commit
06d4cd1e33
1 changed files with 26 additions and 12 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
MenuItem,
|
||||
OutlinedInput,
|
||||
Select,
|
||||
TextField,
|
||||
Theme
|
||||
} from "@mui/material";
|
||||
import moment, { Moment } from "moment";
|
||||
|
|
@ -16,6 +17,7 @@ import ReactDOM from "react-dom";
|
|||
import { DateRangePreset, SetDefaultPreset } from "./DateRange";
|
||||
import ResponsiveDialog from "common/ResponsiveDialog";
|
||||
import { withStyles, WithStyles } from "@mui/styles";
|
||||
import { cloneDeep } from "lodash";
|
||||
|
||||
const styles = (_theme: Theme) => createStyles({});
|
||||
|
||||
|
|
@ -249,18 +251,30 @@ class DateSelect extends React.Component<Props, State> {
|
|||
onClose={this.closeDateRangeDialog}
|
||||
aria-labelledby="date-range-dialog">
|
||||
<DialogContent>
|
||||
{/* <StaticDateRangePicker
|
||||
disableFuture
|
||||
value={dateRange}
|
||||
onChange={date => this.updateDateRange(date)}
|
||||
renderInput={(startProps, endProps) => (
|
||||
<React.Fragment>
|
||||
<TextField {...startProps} />
|
||||
<DateRangeDelimiter> to </DateRangeDelimiter>
|
||||
<TextField {...endProps} />
|
||||
</React.Fragment>
|
||||
)}
|
||||
/> */}
|
||||
<TextField
|
||||
fullWidth
|
||||
margin="normal"
|
||||
type="date"
|
||||
label="Start Time"
|
||||
value={dateRange[0]?.format("YYYY-MM-DD")}
|
||||
onChange={e => {
|
||||
let range = cloneDeep(dateRange)
|
||||
range[0] = moment(e.target.value)
|
||||
this.updateDateRange(range)
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
fullWidth
|
||||
margin="normal"
|
||||
type="date"
|
||||
label="End Time"
|
||||
value={dateRange[1]?.format("YYYY-MM-DD")}
|
||||
onChange={e => {
|
||||
let range = cloneDeep(dateRange)
|
||||
range[1] = moment(e.target.value)
|
||||
this.updateDateRange(range)
|
||||
}}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={this.closeDateRangeDialog} color="primary">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue