Module: Html2rss::Html::ArticleRules::Date
- Defined in:
- lib/html2rss/html/article_rules/date.rb
Overview
DOM-agnostic datetime aggregation for article published_at.
Class Method Summary collapse
-
.earliest(datetime_strings) ⇒ DateTime?
Earliest successfully parsed instant.
Class Method Details
.earliest(datetime_strings) ⇒ DateTime?
Returns earliest successfully parsed instant.
13 14 15 16 17 18 19 20 |
# File 'lib/html2rss/html/article_rules/date.rb', line 13 def earliest(datetime_strings) times = Array(datetime_strings).filter_map do |value| DateTime.parse(value.to_s) rescue ArgumentError, TypeError nil end times.min end |