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";
|
||||
import "react-datepicker/dist/react-datepicker.css";
|
||||
|
||||
interface DateRangePickerProps {
|
||||
minDate: string;
|
||||
maxDate: string;
|
||||
}
|
||||
|
||||
const DateRangePicker: React.FC<DateRangePickerProps> = ({
|
||||
minDate,
|
||||
maxDate,
|
||||
}) => {
|
||||
const DateRangePicker: React.FC = () => {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const reduxVonDatum = useSelector(
|
||||
@@ -30,7 +22,10 @@ const DateRangePicker: React.FC<DateRangePickerProps> = ({
|
||||
const thirtyDaysAgo = new Date();
|
||||
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 [year, month, day] = isoDate.split("-").map(Number);
|
||||
return new Date(year, month - 1, day);
|
||||
@@ -59,8 +54,8 @@ const DateRangePicker: React.FC<DateRangePickerProps> = ({
|
||||
reduxVonDatum ? parseISODate(reduxVonDatum) : thirtyDaysAgo
|
||||
}
|
||||
endDate={reduxBisDatum ? parseISODate(reduxBisDatum) : today}
|
||||
minDate={new Date(minDate)}
|
||||
maxDate={new Date(maxDate)}
|
||||
minDate={sixMonthsAgo} // ⬅️ 6 Monate zurück erlaubt
|
||||
maxDate={today}
|
||||
dateFormat="dd.MM.yyyy"
|
||||
className="border px-2 py-1 rounded"
|
||||
/>
|
||||
@@ -80,8 +75,8 @@ const DateRangePicker: React.FC<DateRangePickerProps> = ({
|
||||
reduxVonDatum ? parseISODate(reduxVonDatum) : thirtyDaysAgo
|
||||
}
|
||||
endDate={reduxBisDatum ? parseISODate(reduxBisDatum) : today}
|
||||
minDate={new Date(minDate)}
|
||||
maxDate={new Date(maxDate)}
|
||||
minDate={sixMonthsAgo}
|
||||
maxDate={today}
|
||||
dateFormat="dd.MM.yyyy"
|
||||
className="border px-2 py-1 rounded"
|
||||
/>
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||
|
||||
*/
|
||||
const webVersion = "1.6.204";
|
||||
const webVersion = "1.6.205";
|
||||
export default webVersion;
|
||||
|
||||
Reference in New Issue
Block a user