On Aug 15, 2011, at 6:01 PM, Bruce D'Arcus wrote: > On Mon, Aug 15, 2011 at 11:48 AM, Sylvester Keil <[email protected]> wrote: >> I've updated the edtf Ruby gem to reflect the latest draft. The parser is >> based on the BNF with minimal changes to resolve a few conflicts and it >> works for all extensions except 201 and 205. The multiple dates (203, 204) >> right now return a simple array, which is to say that whilst features such >> as earlier/later are parsed correctly, that information is not exposed by >> the API. Eventually, we will need a new class to wrap these sets of dates. >> >> A few minor issues will have to be resolved (e.g., how to deal with >> open/unknown intervals or how to sort intervals and seasons), but overall >> you should be able to experiment with the format if you are so inclined. >> Simply, gem install and require 'edtf'; you then parse EDTF with the >> Date.edtf class method. > > Is the following correct according to the spec (note end "to" date for > the interval)? > > irb(main):014:0> d = Date.edtf('1984/1985') > => #<EDTF::Interval:0x45932c @from=#<Date: 1984-01-01 > (4891401/2,0,2299161)>, @to=#<Date: 1985-01-01 (4892133/2,0,2299161)>> > irb(main):015:0> d.from.to_s > => "1984-01-01" > irb(main):016:0> d.to.to_s > => "1985-01-01"
Well spotted! Reading the spec again it's probably more like 1984-01-01T00:00:00 to 1985-12-31:23:59:59. The Interval class will have to be fleshed out in the future. Right now it is a very thin wrapper around a Range. Sylvester ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ xbiblio-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xbiblio-devel
