oscean icon indicating copy to clipboard operation
oscean copied to clipboard

Arvelie cannot represent time before y2k

Open octref opened this issue 5 years ago • 4 comments

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 avatar Oct 23 '20 01:10 octref

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.

neauoire avatar Oct 23 '20 01:10 neauoire

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 avatar Oct 23 '20 01:10 octref

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.

octref avatar Oct 23 '20 09:10 octref

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

neauoire avatar Oct 23 '20 18:10 neauoire