Skip to content

Commit

Permalink
Fix på sivilstand dato
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Oct 31, 2023
1 parent 038daf6 commit 59e0af5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private void fixSivilstand(PersonDTO person) {

person.getSivilstand().sort(Comparator.comparing(SivilstandDTO::getId).reversed());

for (int i = person.getSivilstand().size() - 1; i >= 0; i--) {
for (int i = 0; i < person.getSivilstand().size(); i++) {

fixFolkeregisterMetadata(person.getSivilstand().get(i));

Expand All @@ -207,9 +207,9 @@ private void fixSivilstand(PersonDTO person) {

private static LocalDateTime getRelatertDato(PersonDTO person, int i) {

return i == person.getSivilstand().size() - 1 ? LocalDateTime.now() :
return i == 0 ? LocalDateTime.now() :
person.getSivilstand().get(i - 1)
.getFolkeregistermetadata().getGyldighetstidspunkt().minusDays(1);
.getFolkeregistermetadata().getGyldighetstidspunkt().minusYears(1);
}

private LocalDateTime getSivilstandDato(SivilstandDTO sivilstand) {
Expand Down

0 comments on commit 59e0af5

Please sign in to comment.