1
0
mirror of https://github.com/cmur2/openvpn-status-web.git synced 2025-06-29 10:30:23 +02:00

gem: support date format used by OpenVPN 2.5

- smooth fallback
This commit is contained in:
cn
2022-01-18 01:56:49 +01:00
committed by Christian Nicolai
parent 528709c895
commit 9ad59194bd
4 changed files with 19 additions and 0 deletions

View File

@ -45,6 +45,8 @@ 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
DateTime.strptime(date_string, '%Y-%m-%d %k:%M:%S')
end
end
end