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

This commit is contained in:
cn 2022-01-18 17:06:15 +01:00 committed by Christian Nicolai
parent 9ad59194bd
commit 39adc74fbc
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ module OpenVPNStatusWeb
private_class_method def self.parse_date(date_string)
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')
end
end