mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
fix date conversion in ConfigurationBuilder
This commit is contained in:
parent
d7beb10404
commit
cc7bfb2250
2 changed files with 4 additions and 1 deletions
|
|
@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
### Fixed
|
||||
- date conversion when using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
|
||||
|
||||
## 1.3.1
|
||||
### Fixed
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import static de.kosit.validationtool.impl.DateFactory.createTimestamp;
|
|||
import java.net.URI;
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -107,7 +108,7 @@ public class ConfigurationBuilder {
|
|||
* @return this
|
||||
*/
|
||||
public ConfigurationBuilder date(final Date date) {
|
||||
return date(date != null ? LocalDate.ofEpochDay(date.getTime()) : null);
|
||||
return date(date != null ? date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue