feat: Standard-Zeitraum für Schleifen-/Isolationskurven auf 30 Tage gesetzt, DatePicker erlaubt Auswahl bis 6 Monate zurück gemäß Jira-Anforderung
This commit is contained in:
@@ -8,15 +8,7 @@ import {
|
|||||||
} from "../../../../../../redux/slices/kabelueberwachungChartSlice";
|
} from "../../../../../../redux/slices/kabelueberwachungChartSlice";
|
||||||
import "react-datepicker/dist/react-datepicker.css";
|
import "react-datepicker/dist/react-datepicker.css";
|
||||||
|
|
||||||
interface DateRangePickerProps {
|
const DateRangePicker: React.FC = () => {
|
||||||
minDate: string;
|
|
||||||
maxDate: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const DateRangePicker: React.FC<DateRangePickerProps> = ({
|
|
||||||
minDate,
|
|
||||||
maxDate,
|
|
||||||
}) => {
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const reduxVonDatum = useSelector(
|
const reduxVonDatum = useSelector(
|
||||||
@@ -30,7 +22,10 @@ const DateRangePicker: React.FC<DateRangePickerProps> = ({
|
|||||||
const thirtyDaysAgo = new Date();
|
const thirtyDaysAgo = new Date();
|
||||||
thirtyDaysAgo.setDate(today.getDate() - 30);
|
thirtyDaysAgo.setDate(today.getDate() - 30);
|
||||||
|
|
||||||
// Redux speichert ISO ("YYYY-MM-DD") => Für DatePicker geeignet
|
const sixMonthsAgo = new Date();
|
||||||
|
sixMonthsAgo.setMonth(today.getMonth() - 6);
|
||||||
|
|
||||||
|
// Redux speichert ISO ("YYYY-MM-DD") → Für DatePicker geeignet
|
||||||
const parseISODate = (isoDate: string) => {
|
const parseISODate = (isoDate: string) => {
|
||||||
const [year, month, day] = isoDate.split("-").map(Number);
|
const [year, month, day] = isoDate.split("-").map(Number);
|
||||||
return new Date(year, month - 1, day);
|
return new Date(year, month - 1, day);
|
||||||
@@ -59,8 +54,8 @@ const DateRangePicker: React.FC<DateRangePickerProps> = ({
|
|||||||
reduxVonDatum ? parseISODate(reduxVonDatum) : thirtyDaysAgo
|
reduxVonDatum ? parseISODate(reduxVonDatum) : thirtyDaysAgo
|
||||||
}
|
}
|
||||||
endDate={reduxBisDatum ? parseISODate(reduxBisDatum) : today}
|
endDate={reduxBisDatum ? parseISODate(reduxBisDatum) : today}
|
||||||
minDate={new Date(minDate)}
|
minDate={sixMonthsAgo} // ⬅️ 6 Monate zurück erlaubt
|
||||||
maxDate={new Date(maxDate)}
|
maxDate={today}
|
||||||
dateFormat="dd.MM.yyyy"
|
dateFormat="dd.MM.yyyy"
|
||||||
className="border px-2 py-1 rounded"
|
className="border px-2 py-1 rounded"
|
||||||
/>
|
/>
|
||||||
@@ -80,8 +75,8 @@ const DateRangePicker: React.FC<DateRangePickerProps> = ({
|
|||||||
reduxVonDatum ? parseISODate(reduxVonDatum) : thirtyDaysAgo
|
reduxVonDatum ? parseISODate(reduxVonDatum) : thirtyDaysAgo
|
||||||
}
|
}
|
||||||
endDate={reduxBisDatum ? parseISODate(reduxBisDatum) : today}
|
endDate={reduxBisDatum ? parseISODate(reduxBisDatum) : today}
|
||||||
minDate={new Date(minDate)}
|
minDate={sixMonthsAgo}
|
||||||
maxDate={new Date(maxDate)}
|
maxDate={today}
|
||||||
dateFormat="dd.MM.yyyy"
|
dateFormat="dd.MM.yyyy"
|
||||||
className="border px-2 py-1 rounded"
|
className="border px-2 py-1 rounded"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const webVersion = "1.6.204";
|
const webVersion = "1.6.205";
|
||||||
export default webVersion;
|
export default webVersion;
|
||||||
|
|||||||
Reference in New Issue
Block a user