summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-03 20:34:32 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-03 20:34:32 +0000
commita47bbf7ce093a46ce83cd66da5d9ce3150324860 (patch)
tree36ee17fd93f50c371dba3e8829283fa4bfb98f99 /app/assets/javascripts/vue_shared
parent4bafeeda963a11ce4004bbe35a4ff2606bc4d10a (diff)
downloadgitlab-ce-a47bbf7ce093a46ce83cd66da5d9ce3150324860.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-ee
Diffstat (limited to 'app/assets/javascripts/vue_shared')
-rw-r--r--app/assets/javascripts/vue_shared/components/timezone_dropdown.vue11
1 files changed, 2 insertions, 9 deletions
diff --git a/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue b/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue
index f6721f5a27b..3fa8efcd145 100644
--- a/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue
+++ b/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue
@@ -2,6 +2,7 @@
import { GlDropdown, GlDropdownItem, GlSearchBoxByType } from '@gitlab/ui';
import { __ } from '~/locale';
import autofocusonshow from '~/vue_shared/directives/autofocusonshow';
+import { secondsToHours } from '~/lib/utils/datetime_utility';
export default {
name: 'TimezoneDropdown',
@@ -58,16 +59,8 @@ export default {
isSelected(timezone) {
return this.value === timezone.formattedTimezone;
},
- formatUtcOffset(offset) {
- const parsed = parseInt(offset, 10);
- if (Number.isNaN(parsed) || parsed === 0) {
- return `0`;
- }
- const prefix = offset > 0 ? '+' : '-';
- return `${prefix}${Math.abs(offset / 3600)}`;
- },
formatTimezone(item) {
- return `[UTC ${this.formatUtcOffset(item.offset)}] ${item.name}`;
+ return `[UTC ${secondsToHours(item.offset)}] ${item.name}`;
},
},
};