Skip to content

Commit

Permalink
add logic for same date error
Browse files Browse the repository at this point in the history
  • Loading branch information
BrewCityBoy committed Jan 25, 2024
1 parent 29f38e5 commit 0c041be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Filters/DateFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export const DateFilter = () => {
const style = ['a-text-input'];
if (
dayjs(fromDate).isBefore(minDate) ||
dayjs(fromDate).isAfter(throughDate)
dayjs(fromDate).isAfter(throughDate) ||
dayjs(fromDate).isSame(throughDate)
) {
style.push('a-text-input__error');
}
Expand All @@ -122,7 +123,8 @@ export const DateFilter = () => {
const style = ['a-text-input'];
if (
dayjs(throughDate).isAfter(maxDate) ||
dayjs(throughDate).isBefore(fromDate)
dayjs(throughDate).isBefore(fromDate) ||
dayjs(throughDate).isSame(fromDate)
) {
style.push('a-text-input__error');
}
Expand Down

0 comments on commit 0c041be

Please sign in to comment.