More comprehensive handling of failed date parsing

This commit is contained in:
Dan Milne
2019-10-14 11:35:20 +11:00
parent 6f9d33d778
commit b39134bec1

View File

@@ -42,12 +42,12 @@ module Paapi
def publication_date def publication_date
d = get(%w{ItemInfo ContentInfo PublicationDate DisplayValue}) d = get(%w{ItemInfo ContentInfo PublicationDate DisplayValue})
return d.nil? ? nil : Date.parse(d) return Date.parse(d) rescue nil
end end
def release_date def release_date
d = get(%w{ItemInfo ProductInfo ReleaseDate DisplayValue}) d = get(%w{ItemInfo ProductInfo ReleaseDate DisplayValue})
return d.nil? ? nil : Date.parse(d) return Date.parse(d) rescue nil
end end
def contributors def contributors