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

B.C. dates convertes year to **** #160

Open
loetie opened this issue Feb 16, 2023 · 0 comments
Open

B.C. dates convertes year to **** #160

loetie opened this issue Feb 16, 2023 · 0 comments

Comments

@loetie
Copy link

loetie commented Feb 16, 2023

Dates B.C./A.D. like (eg; {{-2000,1,1},{1,1,1}}) seem to return ****-01-01 as date.
The readme states iso8601 (https://github.com/talentdeficit/jsx) is used.
Iso8601 should support dates B.C./A.D. (https://en.wikipedia.org/wiki/ISO_8601#Years)

I think it happens in this part:
https://github.com/talentdeficit/jsx/blob/main/src/jsx_parser.erl#L125 or 135

Used this to locally test it:

Year = -2000.
Month = 1.
Day = 1.
Hour = 1.
Min = 1.
Sec = 1.
unicode:characters_to_binary(io_lib:format("~4.10.0B-~2.10.0B-~2.10.0BT~2.10.0B:~2.10.0B:~2.10.0BZ",[Year, Month, Day, Hour, Min, Sec]))

Is this a bug? (or am i missing some information about this?)

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