Commit 62d85612 authored by Oleksii Savran's avatar Oleksii Savran

Merge branch...

Merge branch '618-date-filter-doesn-t-work-if-user-enter-same-date-on-the-from-to-fields' into 'master'

Resolve "Date filter doesn't work if user enter same date on the `from` `to` fields;"

Closes #618

See merge request genesys-pgr/genesys-ui!602
parents fbb06b22 c0032f6b
......@@ -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