app/services/edtf_date_service.rb
# A service for indexing and humanzing EDTF dates
# Used by app/indexers/work_indexer for date_created and
# chronological_coverage.
# (see https://www.loc.gov/standards/datetime/).
#
# For extended examples of different types of dates and
# what they index as, see
# spec/services/edtf_date_service_spec.rb
#
# Based on the edtf gem by Sylvester Keil
# (https://github.com/inukshuk/edtf-ruby)
# and the edtf-humanize gem from Duke Libraries.
# (https://github.com/duke-libraries/edtf-humanize)
A service for indexing and humanzing EDTF dates
Used by app/indexers/work_indexer for date_created and
chronological_coverage.

For extended examples of different types of dates and
what they index as, see
spec/services/edtf_date_service_spec.rb

Based on the edtf gem by Sylvester Keil

and the edtf-humanize gem from Duke Libraries.
A service for indexing and humanzing EDTF dates Used by app / indexers / work_indexer for date_created and chronological_coverage . For extended examples of different types of dates and what they index as see spec / services / edtf_date_service_spec . rb Based on the edtf gem by Sylvester Keil and the edtf - humanize gem from Duke Libraries .
def year_range
    case @parsed_date.class.name
    when "Date"
      Array.wrap(@parsed_date.year.to_i)
    when "String"
      nil
    else
      @parsed_date.map { |d| d.year.to_i }.uniq
    end
  end
def year_range case @parsed_date . class . name when "Date" Array . wrap ( @parsed_date . year . to_i ) when "String" nil else @parsed_date . map { | d | d . year . to_i } . uniq end end
A service for indexing and humanzing EDTF dates
Used by app/indexers/work_indexer for date_created and
chronological_coverage.
A service for indexing and humanzing EDTF dates Used by app / indexers / work_indexer for date_created and chronological_coverage .