diff --git a/source/public/index.html b/source/public/index.html
index 76e9f78..b57802c 100644
--- a/source/public/index.html
+++ b/source/public/index.html
@@ -4,8 +4,10 @@
+
-
+
+
{
}}
>
-
-
-
-
+
{
-
-
diff --git a/source/src/pages/Search.tsx b/source/src/pages/Search.tsx
index 293e72e..899718e 100644
--- a/source/src/pages/Search.tsx
+++ b/source/src/pages/Search.tsx
@@ -44,6 +44,24 @@ const StyledSearchControlContainer = styled.div`
}
`
+function isDateInRange(
+ dateToCompare: string,
+ from: string,
+ to: string
+): boolean {
+ if (!dateToCompare) throw Error("No date to compare")
+
+ const isFrom = !!from
+ const isTo = !!to
+
+ if (!isFrom && !isTo) return true
+ if (!isFrom && isTo) return Date.parse(dateToCompare) < Date.parse(to)
+ if (!isTo && isFrom) return Date.parse(dateToCompare) > Date.parse(from)
+
+ const compareDate = Date.parse(dateToCompare)
+ return Date.parse(from) < compareDate && compareDate < Date.parse(to)
+}
+
// todo: find ways to get rid of wrapper component
export default function Search() {
return <_Search />
@@ -70,7 +88,7 @@ function _Search() {
const [dateRange, setDateRange] = useState([
{
- startDate: new Date(),
+ startDate: new Date(0),
endDate: null,
key: "selection",
},
@@ -84,15 +102,6 @@ function _Search() {
<>
pomp | Search
-
-
-
-
-
-
@@ -182,6 +191,20 @@ function _Search() {
Search test 2
+
+