Added cc contract searching by date range BOD-236

This commit is contained in:
Patrick Fic
2020-07-29 10:48:11 -07:00
parent b51f5b0db2
commit 1f95b37778
8 changed files with 247 additions and 30 deletions

View File

@@ -10,13 +10,22 @@ export default function TimeTicketsDatesSelector() {
const history = useHistory();
const handleChange = (dates) => {
const [start, end] = dates;
if (dates) {
const [start, end] = dates;
if (!!start && !!end) {
if (!!start && !!end) {
history.push({
search: queryString.stringify({
start: start.format("YYYY-MM-DD"),
end: end.format("YYYY-MM-DD"),
}),
});
}
} else {
history.push({
search: queryString.stringify({
start: start.format("YYYY-MM-DD"),
end: end.format("YYYY-MM-DD"),
start: null,
end: null,
}),
});
}