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

Arvelie cannot represent time before y2k #62

Open
octref opened this issue Oct 23, 2020 · 4 comments
Open

Arvelie cannot represent time before y2k #62

octref opened this issue Oct 23, 2020 · 4 comments

Comments

@octref
Copy link

octref commented Oct 23, 2020

I'd like to use arvelie to denote moment in the past or future.

Time such as 02A01 refers to 2002-01-01, but 1902-01-01 finds no representation in arvelie.

@octref octref changed the title Arvelie cannot represent years such as 1902 Arvelie cannot represent time before y2k Oct 23, 2020
@neauoire
Copy link
Member

neauoire commented Oct 23, 2020

If you need to point to addresses in another century, you will need to use the 1902A01 format.
Is that something that you need implemented in the arvelie.h file? I could add support for that if you're using it.

@octref
Copy link
Author

octref commented Oct 23, 2020

Thanks for the quick answer! I'm implementing a JS version (EDIT: https://github.com/octref/arvelie) to use it on my own website.
I compiled the reference C library, and also notice that:

 arvelie > ./arvelie 03+01
Error: Invalid arvelie date (Expecting 2003-12-31)
 arvelie > ./arvelie 20+02
Error: Invalid arvelie date (Expecting 2020-02-29)

Is that something that you need implemented in the arvelie.h file? I could add support for that if you're using it.

It seems you are handling input of length 5 and 10, so handling input of length 7 would be great, as it must be an arvelie date with full year. I can also send a PR myself.

@octref
Copy link
Author

octref commented Oct 23, 2020

I have a patch that makes it work this way:

> ./arvelie 1920A01   
1920-01-01
# if year is not 20xx, use full arvelie format
> ./arvelie 1920-01-01
1920A01

Does that look fine to you? If so I'll send a PR.

@neauoire
Copy link
Member

as long as it doesn't break compat with the current format sure :)

octref added a commit to octref/oscean that referenced this issue Oct 27, 2020
octref added a commit to octref/oscean that referenced this issue Oct 27, 2020
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

2 participants