diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-16 16:53:08 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-16 16:53:08 +0300 |
commit | a72c39d39f2c2fa127139c9e161bacaecbcb5a07 (patch) | |
tree | 2efa43295d0da364f2c23c3286f68dc55f94d0dd /src/components | |
parent | 2cb62b657f9e806bdbeadd50ba932d204f696393 (diff) | |
download | webui-vue-a72c39d39f2c2fa127139c9e161bacaecbcb5a07.tar.xz |
add timeZone select
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/_sila/Mixins/LocalTimezoneLabelMixin.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/components/_sila/Mixins/LocalTimezoneLabelMixin.js b/src/components/_sila/Mixins/LocalTimezoneLabelMixin.js index 7ef7636b..ffa54d59 100644 --- a/src/components/_sila/Mixins/LocalTimezoneLabelMixin.js +++ b/src/components/_sila/Mixins/LocalTimezoneLabelMixin.js @@ -7,6 +7,16 @@ const LocalTimezoneLabelMixin = { const pattern = ' O'; return format(new Date(), pattern, { timezone }).replace('GMT', 'UTC'); }, + timeZones() { + const intlTimeZones = Intl.supportedValuesOf('timeZone'); + const pattern = 'O'; + return intlTimeZones.map((timeZone) => { + let utc = format(new Date(), pattern, { + timeZone, + }).replace('GMT', 'UTC'); + return `(${utc}) ${timeZone}`; + }); + }, }, }; |