lib/bolognese/readers/schema_org_reader.rb in bolognese-1.3.11 vs lib/bolognese/readers/schema_org_reader.rb in bolognese-1.3.13
- old
+ new
@@ -122,12 +122,12 @@
{
"funderName" => fr["name"] }.compact
end
end
dates = []
- dates << { "date" => meta.fetch("datePublished"), "dateType" => "Issued" } if meta.fetch("datePublished", nil).present?
- dates << { "date" => meta.fetch("dateCreated"), "dateType" => "Created" } if meta.fetch("dateCreated", nil).present?
- dates << { "date" => meta.fetch("dateModified"), "dateType" => "Updated" } if meta.fetch("dateModified", nil).present?
+ dates << { "date" => meta.fetch("datePublished"), "dateType" => "Issued" } if Date.edtf(meta.fetch("datePublished", nil)).present?
+ dates << { "date" => meta.fetch("dateCreated"), "dateType" => "Created" } if Date.edtf(meta.fetch("dateCreated", nil)).present?
+ dates << { "date" => meta.fetch("dateModified"), "dateType" => "Updated" } if Date.edtf(meta.fetch("dateModified", nil)).present?
publication_year = meta.fetch("datePublished")[0..3] if meta.fetch("datePublished", nil).present?
state = meta.present? || read_options.present? ? "findable" : "not_found"
geo_locations = Array.wrap(meta.fetch("spatialCoverage", nil)).map do |gl|
if gl.dig("geo", "box")