From 5f32e55a87011f0e68479f895f50e88994077026 Mon Sep 17 00:00:00 2001 From: Jesper Paulsen Date: Tue, 30 May 2023 12:39:23 +0200 Subject: [PATCH] =?UTF-8?q?[OPP-1542]=20Kun=20vise=20datoer=203=20=C3=A5r?= =?UTF-8?q?=20tilbake=20i=20tid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utbetalinger/filter/EgendefinertDatoInputs.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/personside/infotabs/utbetalinger/filter/EgendefinertDatoInputs.tsx b/src/app/personside/infotabs/utbetalinger/filter/EgendefinertDatoInputs.tsx index c0e3d3dc9..ed13a95e3 100644 --- a/src/app/personside/infotabs/utbetalinger/filter/EgendefinertDatoInputs.tsx +++ b/src/app/personside/infotabs/utbetalinger/filter/EgendefinertDatoInputs.tsx @@ -25,9 +25,7 @@ function onDatoChange(props: Props, dato: Partial) { }); } -const tidligsteDato = dayjs() - .subtract(5, 'years') - .startOf('year'); +const tidligsteDato = dayjs().subtract(3, 'years').startOf('year'); const senesteDato: Dayjs = dayjs(); const isoTidligsteDato = tidligsteDato.format(ISO_DATE_STRING_FORMAT); @@ -69,8 +67,9 @@ const periodeValidering = [ function getDatoFeilmelding(fra: string, til: string) { const fraDato = dayjs(fra, ISO_DATE_STRING_FORMAT); const tilDato = dayjs(til, ISO_DATE_STRING_FORMAT); - const feilmelding: string | undefined = periodeValidering.find(validering => validering.erUgyldig(fraDato, tilDato)) - ?.feilmelding; + const feilmelding: string | undefined = periodeValidering.find((validering) => + validering.erUgyldig(fraDato, tilDato) + )?.feilmelding; if (feilmelding) { return {feilmelding}; } @@ -93,7 +92,7 @@ function EgendefinertDatoInputs(props: Props) { locale={'nb'} inputId="utbetalinger-datovelger-fra" value={fra} - onChange={dato => onDatoChange(props, { fra: dato })} + onChange={(dato) => onDatoChange(props, { fra: dato })} inputProps={{ name: 'Fra dato', 'aria-invalid': fra !== '' && isISODateString(fra) === false @@ -113,7 +112,7 @@ function EgendefinertDatoInputs(props: Props) { locale={'nb'} inputId="utbetalinger-datovelger-til" value={til} - onChange={dato => onDatoChange(props, { til: dato })} + onChange={(dato) => onDatoChange(props, { til: dato })} inputProps={{ name: 'Til dato', 'aria-invalid': til !== '' && isISODateString(til) === false