gem: Date::Error is not in Ruby 2.6 and older, use ArgumentError

This commit is contained in:
cn
2022-01-18 17:07:33 +01:00
committed by cn
parent 9ad59194bd
commit 39adc74fbc
@@ -45,7 +45,7 @@ module OpenVPNStatusWeb
private_class_method def self.parse_date(date_string) private_class_method def self.parse_date(date_string)
DateTime.strptime(date_string, '%a %b %d %k:%M:%S %Y') DateTime.strptime(date_string, '%a %b %d %k:%M:%S %Y')
rescue Date::Error rescue ArgumentError
DateTime.strptime(date_string, '%Y-%m-%d %k:%M:%S') DateTime.strptime(date_string, '%Y-%m-%d %k:%M:%S')
end end
end end