Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fix: flatpicker

kruzhambus2928834acf0f
diff --git a/src/ui/Flatpicker.tsx b/src/ui/Flatpicker.tsx
index febe5367c..f387ef027 100644
--- a/src/ui/Flatpicker.tsx
+++ b/src/ui/Flatpicker.tsx
@@ -42,8 +42,7 @@ class FlatPicker extends React.Component<FlatPickerProps, {
private setCustomDate(dates: Date[]) {
const { onChange, maxRange } = this.props
- // set max date to the first date selected using maxRange
- if (maxRange && _size(dates) === 1) {
+ if (maxRange && maxRange > 0 && _size(dates) === 1) {
const maxDate = new Date(dates[0])
const minDate = new Date(dates[0])
maxDate.setDate(maxDate.getDate() + maxRange)