Skip to content

Commit

Permalink
Truncating ZoneDateTimes to millis for accurate comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Sep 1, 2023
1 parent 3a28d95 commit a6dc59d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/computate/frFR/java/EcrireGenClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -3560,7 +3560,11 @@ else if(entiteSetUpper)
else {
l();
tl(1, "public void set", entiteVarCapitalise, "(", entiteNomSimpleComplet, " ", entiteVar, ") {");
tl(2, "this.", entiteVar, " = ", entiteVar, ";");
if(StringUtils.equals(entiteNomCanonique, ZonedDateTime.class.getCanonicalName())) {
tl(2, "this.", entiteVar, " = Optional.ofNullable(", entiteVar, ").map(v -> v.truncatedTo(ChronoUnit.MILLIS)).orElse(null);");
} else {
tl(2, "this.", entiteVar, " = ", entiteVar, ";");
}
tl(1, "}");
}

Expand Down

0 comments on commit a6dc59d

Please sign in to comment.