lib/psulib_traject/processors/pub_date.rb
# For when we are dealing with ranges.
For when we are dealing with ranges.
For when we are dealing with ranges .
def resolve_range(date1_str, date2_str)
      date1 = date1_str.tr('u', '0').to_i
      date2 = date2_str.tr('u', '9').to_i
      return unless (date2 > date1) && ((date2 - date1) <= ESTIMATE_TOLERANCE)
      (date2 + date1) / 2
    end
def resolve_range ( date1_str , date2_str ) date1 = date1_str . tr ( 'u' , '0' ) . to_i date2 = date2_str . tr ( 'u' , '9' ) . to_i return unless ( date2 > date1 ) && ( ( date2 - date1 ) <= ESTIMATE_TOLERANCE ) ( date2 + date1 ) / 2 end
For when we are dealing with ranges.
For when we are dealing with ranges .
# Make unknown digits at the beginning or end of range # Do we have a range we can use?
date1_str
date2_str