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,
|
MenuItem,
|
||||||
OutlinedInput,
|
OutlinedInput,
|
||||||
Select,
|
Select,
|
||||||
|
TextField,
|
||||||
Theme
|
Theme
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import moment, { Moment } from "moment";
|
import moment, { Moment } from "moment";
|
||||||
|
|
@ -16,6 +17,7 @@ import ReactDOM from "react-dom";
|
||||||
import { DateRangePreset, SetDefaultPreset } from "./DateRange";
|
import { DateRangePreset, SetDefaultPreset } from "./DateRange";
|
||||||
import ResponsiveDialog from "common/ResponsiveDialog";
|
import ResponsiveDialog from "common/ResponsiveDialog";
|
||||||
import { withStyles, WithStyles } from "@mui/styles";
|
import { withStyles, WithStyles } from "@mui/styles";
|
||||||
|
import { cloneDeep } from "lodash";
|
||||||
|
|
||||||
const styles = (_theme: Theme) => createStyles({});
|
const styles = (_theme: Theme) => createStyles({});
|
||||||
|
|
||||||
|
|
@ -249,18 +251,30 @@ class DateSelect extends React.Component<Props, State> {
|
||||||
onClose={this.closeDateRangeDialog}
|
onClose={this.closeDateRangeDialog}
|
||||||
aria-labelledby="date-range-dialog">
|
aria-labelledby="date-range-dialog">
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
{/* <StaticDateRangePicker
|
<TextField
|
||||||
disableFuture
|
fullWidth
|
||||||
value={dateRange}
|
margin="normal"
|
||||||
onChange={date => this.updateDateRange(date)}
|
type="date"
|
||||||
renderInput={(startProps, endProps) => (
|
label="Start Time"
|
||||||
<React.Fragment>
|
value={dateRange[0]?.format("YYYY-MM-DD")}
|
||||||
<TextField {...startProps} />
|
onChange={e => {
|
||||||
<DateRangeDelimiter> to </DateRangeDelimiter>
|
let range = cloneDeep(dateRange)
|
||||||
<TextField {...endProps} />
|
range[0] = moment(e.target.value)
|
||||||
</React.Fragment>
|
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>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={this.closeDateRangeDialog} color="primary">
|
<Button onClick={this.closeDateRangeDialog} color="primary">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue