Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix temporal codecs for years having less than 3 digits #800

Merged
merged 1 commit into from Feb 15, 2023

Conversation

francesconero
Copy link
Contributor

Hello,

I noticed that the way skunk currently serializes dates doesn't pad the year to 4 digits.

This causes Postgres to interpret LocalDate.of(1, 2, 3) (serialized as 1-02-03) as January 2nd 2003, instead of February 3rd 2001.
It also just raises an error in cases where the year is greater than 12 (because it interprets it as a month).

This fix just pads the year to 4 digits serializing LocalDate.of(1, 2, 3) as 0001-02-03, which Postgres interprets correctly.

@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Merging #800 (d412f35) into main (ed21904) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #800   +/-   ##
=======================================
  Coverage   84.95%   84.95%           
=======================================
  Files         126      126           
  Lines        1721     1721           
  Branches      127      125    -2     
=======================================
  Hits         1462     1462           
  Misses        259      259           
Impacted Files Coverage Δ
...e/shared/src/main/scala/codec/TemporalCodecs.scala 87.27% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mpilquist mpilquist merged commit 723f096 into typelevel:main Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants