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

Date with BC note in PostgreSQL parsed incorrectly #500

Open
SamyRai opened this issue Oct 21, 2018 · 0 comments
Open

Date with BC note in PostgreSQL parsed incorrectly #500

SamyRai opened this issue Oct 21, 2018 · 0 comments

Comments

@SamyRai
Copy link

SamyRai commented Oct 21, 2018

Hello,

I am using:

hanami (1.2.0)
hanami-model (1.2.0)

and PostgreSQL 10.5 with table authors in it. This table has a column date_of_birth (Date type).
I have an entity Author with schema containing date_of_birth attribute and type Types::Date.

For one author this column contains following

=# select date_of_birth from authors where id='0a33078c-c440-4279-9cc7-172b8684b87a'
 date_of_birth 
---------------
 0530-01-01 BC
(1 row)

If i try to parse this string manually via

 Date.parse('0530-01-01 BC').year => -529

I get correct date with minus.

But if I do this

@author_repo.find(params[:author_id]).date_of_birth.year => 530

it ignores BC part.

Could you tell me if I am doing something wrong or if it an issue. If last, maybe you could give me a hint where I can take a look to help you to solve this issue.

Cheers!

@SamyRai SamyRai changed the title Date with BC note in PostgreSQL parses incorrectly Date with BC note in PostgreSQL parsed incorrectly Oct 21, 2018
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

No branches or pull requests

1 participant