Commit c0032f6b authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Oleksii Savran

FIX: Date filter doesn't work if enter same date on the `from` `to` fields

parent fbb06b22
......@@ -67,12 +67,28 @@ class DateFilterInternal extends React.Component<IDateFilterInternal, any> {
private textAChange = (event) => {
this.setState({dateA: event.target.value, dateB: this.state.dateB});
this.report({ge: event.target.value && new Date(event.target.value), le: this.state.dateB && new Date(this.state.dateB)});
const startDay = event.target.value && new Date(event.target.value);
if (startDay) {
startDay.setHours(0);
}
const endDay = this.state.dateB && new Date(this.state.dateB);
if (endDay) {
endDay.setHours(23, 59, 59);
}
this.report({ge: startDay, le: endDay});
}
private textBChange = (event) => {
this.setState({ dateA: this.state.dateA, dateB: event.target.value });
this.report({ge: this.state.dateA && new Date(this.state.dateA), le: event.target.value && new Date(event.target.value)});
const startDay = this.state.dateA && new Date(this.state.dateA);
if (startDay) {
startDay.setHours(0);
}
const endDay = event.target.value && new Date(event.target.value);
if (endDay) {
endDay.setHours(23, 59, 59);
}
this.report({ge: startDay, le: endDay});
}
public render() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment