LocalDateToDateConverter converts to wrong values (for very old dates)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
The LocalDateToDateConverter in vaadin 8.3.1 converts the value too naive.
Depending on the current time zone there might be some time gabs because of different calendar adjustments. For example in TimeZone "Europe/Berlin" there was a time gab of 0:06:32h on April 1st 1893. (https://www.timeanddate.com/time/zone/germany/berlin?year=1893). That means: If you enter a LocalDate of 1893-04-01 it is converted to Date 1893-04-04 00:06:32.
Further time gab of several days was on 1582-10-15 (Julian Calendar to Gregorian Calendar).
A quite good explanation and a hint for correct conversion is given on https://stackoverflow.com/questions/44801189/how-to-convert-util-date-to-time-localdate-correctly-for-dates-before-1893/44802513
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating LocalDateToDateConverter and reproducing the reported conversions in the Europe/Berlin time zone, including 1893-04-01 and 1582-10-15. Compare the resulting Date values with the intended calendar dates and add regression coverage for old dates; done means conversion no longer introduces the reported time or multi-day gaps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100