summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-09-16 16:53:08 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-09-16 16:53:08 +0300
commita72c39d39f2c2fa127139c9e161bacaecbcb5a07 (patch)
tree2efa43295d0da364f2c23c3286f68dc55f94d0dd /src/components
parent2cb62b657f9e806bdbeadd50ba932d204f696393 (diff)
downloadwebui-vue-a72c39d39f2c2fa127139c9e161bacaecbcb5a07.tar.xz
add timeZone select
Diffstat (limited to 'src/components')
-rw-r--r--src/components/_sila/Mixins/LocalTimezoneLabelMixin.js10
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}`;
+ });
+ },
},
};