lib/commonmeta/utils.rb in commonmeta-ruby-3.0.1 vs lib/commonmeta/utils.rb in commonmeta-ruby-3.0.2
- old
+ new
@@ -1051,13 +1051,13 @@
[year.to_i, month.to_i, day.to_i].reject { |part| part == 0 }
end
# parsing of incomplete iso8601 timestamps such as 2015-04 is broken
- # in standard library
+ # in standard library, so we use the edtf gem
# return nil if invalid iso8601 timestamp
def get_datetime_from_iso8601(iso8601_time)
- ISO8601::DateTime.new(iso8601_time).to_time.utc
+ Date.edtf(iso8601_time).to_time.utc
rescue StandardError
nil
end
# strip milliseconds if there is a time, as it interferes with edtc parsing