Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-02 18:09:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-02 18:09:37 +0300
commit1bdf79827c623cc92504223a1085f366115bbb3d (patch)
tree80ed68ac6c4fcb59bdd4735120da8e241f7f99a2 /app/helpers/time_zone_helper.rb
parent21e08b6197f192c983f8527f4bba1f2aaec8abf2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/time_zone_helper.rb')
-rw-r--r--app/helpers/time_zone_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/time_zone_helper.rb b/app/helpers/time_zone_helper.rb
new file mode 100644
index 00000000000..daf99ad9b5e
--- /dev/null
+++ b/app/helpers/time_zone_helper.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module TimeZoneHelper
+ def timezone_data
+ ActiveSupport::TimeZone.all.map do |timezone|
+ {
+ identifier: timezone.tzinfo.identifier,
+ name: timezone.name,
+ abbr: timezone.tzinfo.strftime('%Z'),
+ offset: timezone.now.utc_offset,
+ formatted_offset: timezone.now.formatted_offset
+ }
+ end
+ end
+end