Skip to content

Commit

Permalink
Merge pull request #2950 from navikt/bugfix/fremmote-parsing
Browse files Browse the repository at this point in the history
Fix fremmote tidspunkt parsing
  • Loading branch information
fredrikpe authored Dec 13, 2023
2 parents 692fb54 + ced7f10 commit 9414e5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function fremmoteTidFromTidspunkt(fremmoteTidspunkt?: string): string | u
if (!fremmoteTidspunkt) return undefined;
const d = new Date(fremmoteTidspunkt);

return `${d.getHours()}:${d.getMinutes()}`;
return `${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`;
}

export function utkastDataEllerDefault(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,19 @@ export function TiltaksgjennomforingDetaljer(props: Props) {
header="Fremmøte tidspunkt"
verdi={
<div>
{`${fremmoteDatoFromTidspunkt(
tiltaksgjennomforing.fremmoteTidspunkt,
)} ${fremmoteTidFromTidspunkt(tiltaksgjennomforing.fremmoteTidspunkt)}`}
{`${formaterDato(
fremmoteDatoFromTidspunkt(tiltaksgjennomforing.fremmoteTidspunkt),
"Ikke satt",
)} ${fremmoteTidFromTidspunkt(tiltaksgjennomforing.fremmoteTidspunkt) ?? ""}`}
</div>
}
/>
</Bolk>
<Bolk aria-label="Antall plasser">
<Metadata header="Fremmøte sted" verdi={tiltaksgjennomforing.fremmoteSted} />
<Metadata
header="Fremmøte sted"
verdi={tiltaksgjennomforing.fremmoteSted ?? "Ikke satt"}
/>
</Bolk>
</>
) : tiltaksgjennomforing.stedForGjennomforing ? (
Expand Down

0 comments on commit 9414e5f

Please sign in to comment.