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!

reset minDate and maxDate on open

kruzhambus195d7ccc6bf6
diff --git a/src/ui/Flatpicker.tsx b/src/ui/Flatpicker.tsx
index f8b5ba315..5e6e11310 100644
--- a/src/ui/Flatpicker.tsx
+++ b/src/ui/Flatpicker.tsx
@@ -61,6 +61,11 @@ class FlatPicker extends React.Component<FlatPickerProps, {
private openCalendar = () => {
if (this.calendar.current) {
+ this.setState({
+ maxDate: 'today',
+ // eslint-disable-next-line react/destructuring-assignment
+ minDate: this.removeMonths(new Date(), this.props?.maxDateMonths || 24),
+ })
this.calendar.current.flatpickr.open()
}
}