lib/feedjira/date_time_utilities.rb
def parse_datetime(string)
      res = DATE_PARSERS.detect do |parser|
        return parser.parse(string).feed_utils_to_gm_time
      rescue StandardError => e
        Feedjira.logger.debug { "Failed to parse date #{string}" }
        Feedjira.logger.debug(e)
        nil
      end

      Feedjira.logger.warn { "Failed to parse date #{string}" } if res.nil?

      res
    end
# Parse the given string starting with the most common parser (default ruby)
# and going over all other available parsers
Parse the given string starting with the most common parser (default ruby)
and going over all other available parsers
Parse the given string starting with the most common parser ( default ruby ) and going over all other available parsers
def parse_datetime(string)
      res = DATE_PARSERS.detect do |parser|
        return parser.parse(string).feed_utils_to_gm_time
      rescue StandardError => e
        Feedjira.logger.debug { "Failed to parse date #{string}" }
        Feedjira.logger.debug(e)
        nil
      end
      Feedjira.logger.warn { "Failed to parse date #{string}" } if res.nil?
      res
    end
def parse_datetime ( string ) res = DATE_PARSERS . detect do | parser | return parser . parse ( string ) . feed_utils_to_gm_time rescue StandardError => e Feedjira . logger . debug { "Failed to parse date #{string}" } Feedjira . logger . debug ( e ) nil end Feedjira . logger . warn { "Failed to parse date #{string}" } if res . nil? res end
Parse the given string starting with the most common parser (default ruby)
and going over all other available parsers
Parse the given string starting with the most common parser ( default ruby ) and going over all other available parsers
string