|
|
|
@ -17,6 +17,7 @@ import Select from '@material-ui/core/Select'; |
|
|
|
|
import TextField from '@material-ui/core/TextField'; |
|
|
|
|
import ScheduleIcon from '@material-ui/icons/Schedule'; |
|
|
|
|
import DateFnsUtils from '@date-io/date-fns'; |
|
|
|
|
import { format } from 'date-fns'; |
|
|
|
|
import { MuiPickersUtilsProvider, DateTimePicker } from "@material-ui/pickers"; |
|
|
|
|
|
|
|
|
|
import { makeStyles } from '@material-ui/core/styles'; |
|
|
|
@ -76,7 +77,7 @@ export function EditTimeFilterExpression(props) { |
|
|
|
|
<Select |
|
|
|
|
labelId={labelid} |
|
|
|
|
id={id} |
|
|
|
|
value={filter.operator} |
|
|
|
|
value={filter.type} |
|
|
|
|
onChange={handleChangeType} |
|
|
|
|
> |
|
|
|
|
<MenuItem value={TimeFilterTypeEnum.BEFORE}>Before</MenuItem> |
|
|
|
@ -499,7 +500,7 @@ export function TimeFilterExpressionControl(props) { |
|
|
|
|
const classes = useStyles(); |
|
|
|
|
const { expr, onClick, onChange } = props; |
|
|
|
|
|
|
|
|
|
const relation = ""; |
|
|
|
|
var relation = ""; |
|
|
|
|
if (expr.type == TimeFilterTypeEnum.BEFORE) { |
|
|
|
|
relation = "Before: "; |
|
|
|
|
} else if (expr.type == TimeFilterTypeEnum.AFTER) { |
|
|
|
@ -508,6 +509,8 @@ export function TimeFilterExpressionControl(props) { |
|
|
|
|
throw new Error("Unsupported time filter type."); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const datestr = format( expr.time, "yyyy-MM-dd, HH:mm:ss"); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Button |
|
|
|
|
variant="outlined" |
|
|
|
@ -515,8 +518,7 @@ export function TimeFilterExpressionControl(props) { |
|
|
|
|
aria-controls="simple-menu" aria-haspopup="true" |
|
|
|
|
onClick={onClick} |
|
|
|
|
startIcon={<ScheduleIcon />}> |
|
|
|
|
> |
|
|
|
|
{relation + expr.time.toLocaleStr()} |
|
|
|
|
{relation + datestr} |
|
|
|
|
</Button> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|