edtf-ruby icon indicating copy to clipboard operation
edtf-ruby copied to clipboard

Impossible to use unspecified digits in intervals

Open ghost opened this issue 5 years ago • 0 comments

I found out empirically that you have to use 'x' for unspecified digits so that the date is typed as a century, and 'u' so that it is accepted in an interval: you can't do both at the same time. So you can't say "from the 19th century to the 20th century."

> Date.edtf('19uu').class
=> Date
> Date.edtf('19xx').class
=> EDTF::Century
> Date.edtf('19xx/2000').class
=> NilClass
> Date.edtf!('19xx/2000').class
ArgumentError (failed to parse date: unexpected '/' at [#<EDTF::Century:0x00005580cf514c80 @year=1900>])
> Date.edtf('19uu/2000').class
=> EDTF::Interval
> Date.edtf('19uu/2000').from.class
=> Date

ghost avatar Jun 11 '20 05:06 ghost