Skip to content

Releases: sul-dlss/parse_date

v0.4.2

06 Nov 23:16
Compare
Choose a tag to compare

parse yyyy-y date strings

  • e.g. '1993-7' will correctly parse out latest_year and range

v0.4.1

06 Nov 17:21
Compare
Choose a tag to compare

parse yyy0s date strings

  • e.g. '1990s', '1928-1980s', '1940s-1990', '1980s-1990s' give correct latest_year and ranges

v0.4.0

01 Nov 17:50
Compare
Choose a tag to compare

return nil rather than raising exception when string is unparseable or is comprised solely of invalid years

v0.3.4

29 Oct 17:17
Compare
Choose a tag to compare

parse yyy-yy date string

  • fix latest_year to correctly parse values such as "950-60" (i.e. 960)

parse yyy-yyyy date string

  • fix earliest_year to correctly parse values such as "996–1021 CE" (i.e. 966)

parse year to year date string

  • fix latest year to correctly parse values such as "1500? to 1582" (i.e. 1582)

v0.3.3

28 Oct 16:36
Compare
Choose a tag to compare

Fix bug parsing negative latest year

  • fix latest_year with values such as "-0100", which were parsing out to 100 instead of -100

Treat long hyphen char as regular hyphen

  • 1230—1239 has a long hyphen char (as opposed to 1230-1239); treat long hyphen as hyphen for parsing out latest year.

v0.3.2

24 Oct 21:06
Compare
Choose a tag to compare

Allow earlier dates

  • '502-504' -- parse range correctly
  • '-2100 - -2000' -- parse range correctly

v0.3.1

22 Oct 16:19
Compare
Choose a tag to compare

Fix bug with four_digit_year

  • correct answer on real data 19990211 is more important than throwing exception on fake data 12345

v0.3.0

22 Oct 00:47
Compare
Choose a tag to compare

Add methods:

(documented in README and in specs)

  • ParseDate.parse_range
  • ParseDate.range_array
  • ParseDate.year_range_valid?

Parse more patterns and distinguish between earliest and latest years:

  • between year1 and year2 (including BC)
  • year1 or year2
  • yyyy-yyyy
  • yyyy-yy for latest year (e.g. 1975-79)
  • yyuu-yyuu for latest year
  • nth century BC for latest year
  • nth - qth century for earliest and latest year (including BC)

v0.2.0

09 Oct 22:46
Compare
Choose a tag to compare
  • earliest_year is new name of "year_int_from_date_str"
  • latest_year added
    • not yet addressing things like "16th - 17th century" or "1969-73", but it's a start. Should work for 4 char dates from marc, in any case.

v0.1.0

07 Oct 20:32
Compare
Choose a tag to compare

Adds the following:

  • year_int_from_date_str
  • year_int_valid?