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 century_or_decade_interval?(date_string)
    first_date = date_string.split("/").first
    last_date = date_string.split("/").second
    (century?(first_date) and century?(last_date)) ||
        (decade?(first_date) and decade?(last_date))
  end
def century_or_decade_interval? ( date_string ) first_date = date_string . split ( "/" ) . first last_date = date_string . split ( "/" ) . second ( century? ( first_date ) and century? ( last_date ) ) || ( decade? ( first_date ) and decade? ( last_date ) ) 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 .
date_string
<not_specific>