@tak-ps/vue-tabler 3.16.0 → 3.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/components/Epoch.vue +2 -2
- package/components/input/TimeZone.vue +61 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
package/components/Epoch.vue
CHANGED
|
@@ -51,9 +51,9 @@ export default {
|
|
|
51
51
|
let suffix = this.suffix[day.slice(day.length - 1)] || 'th';
|
|
52
52
|
if (['11', '12', '13'].includes(day)) suffix = 'th';
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
let res = `${this.months[date.getUTCMonth()]} ${date.getUTCDate()}${suffix}`;
|
|
55
55
|
if (date.getFullYear() !== new Date().getFullYear()) {
|
|
56
|
-
|
|
56
|
+
res + ` ${date.getFullYear()}`;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
res = res + `, ${String(date.getUTCHours()).padStart(2, '0')}:${String(date.getMinutes()).padEnd(2, '0')}`;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TablerEnum
|
|
3
|
+
:label='label'
|
|
4
|
+
:options='Array.from(timezones)'
|
|
5
|
+
:default='modelValue'
|
|
6
|
+
v-on:change='$emit("update:modelValue", $event.target.value)'
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import {
|
|
12
|
+
TablerEnum
|
|
13
|
+
} from '@tak-ps/vue-tabler'
|
|
14
|
+
import moment from 'moment-timezone';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'TimeZone',
|
|
18
|
+
props: {
|
|
19
|
+
modelValue: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
label: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'Default Timezone'
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
data: function() {
|
|
33
|
+
const timezones = new Set();
|
|
34
|
+
|
|
35
|
+
for (const tz of moment.tz.names()
|
|
36
|
+
.reduce((memo, tz) => {
|
|
37
|
+
memo.push({
|
|
38
|
+
name: tz,
|
|
39
|
+
offset: moment.tz(tz).utcOffset()
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return memo;
|
|
43
|
+
}, [])
|
|
44
|
+
.sort((a, b) => {
|
|
45
|
+
return a.offset - b.offset
|
|
46
|
+
})) {
|
|
47
|
+
const timezone = tz.offset ? moment.tz(tz.name).format('Z') : '';
|
|
48
|
+
|
|
49
|
+
timezones.add(`(GMT${timezone}) ${tz.name}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
internal: this.modelValue,
|
|
54
|
+
timezones
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
components: {
|
|
58
|
+
TablerEnum
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tak-ps/vue-tabler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.17.0",
|
|
5
5
|
"lib": "lib.js",
|
|
6
6
|
"module": "lib.js",
|
|
7
7
|
"description": "Tabler UI components for Vue3",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/tak-ps/vue-tabler#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"moment-timezone": "^0.5.43",
|
|
23
24
|
"showdown": "^2.1.0",
|
|
24
25
|
"vue-tabler-icons": "^2.16.0"
|
|
25
26
|
},
|