rescue undefined timezone

This commit is contained in:
Alex Turchyn committed 2023-09-24 11:21:50 +03:00
1 parent ef8c3cfe7f
commit f8712a9da9
1 file changed
+2
+2
View File
@@ -68,5 +68,7 @@ module Accounts
tzinfo = TZInfo::Timezone.get(ActiveSupport::TimeZone::MAPPING[timezone] || timezone)
::ActiveSupport::TimeZone.all.find { |e| e.tzinfo == tzinfo }&.name || timezone
rescue TZInfo::InvalidTimezoneIdentifier
'UTC'
end
end