@tak-ps/vue-tabler 3.84.0 → 3.85.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 +4 -0
- package/components/Epoch.vue +3 -3
- package/components/EpochRange.vue +8 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/components/Epoch.vue
CHANGED
|
@@ -45,16 +45,16 @@ const display = computed(() => {
|
|
|
45
45
|
.replace('T', ' ')
|
|
46
46
|
.replace(/:[0-9]+\.[0-9]+[A-Z]/, '')
|
|
47
47
|
} else if (props.format === 'Human') {
|
|
48
|
-
const day = String(date.
|
|
48
|
+
const day = String(date.getDate())
|
|
49
49
|
let suf = suffix[day.slice(day.length - 1)] || 'th'
|
|
50
50
|
if (['11', '12', '13'].includes(day)) suf = 'th'
|
|
51
51
|
|
|
52
|
-
let res = `${months[date.
|
|
52
|
+
let res = `${months[date.getMonth()]} ${date.getDate()}${suf}`
|
|
53
53
|
if (date.getFullYear() !== new Date().getFullYear()) {
|
|
54
54
|
res = res + ` ${date.getFullYear()}`
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
res = res + `, ${String(date.
|
|
57
|
+
res = res + `, ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
|
|
58
58
|
|
|
59
59
|
return res
|
|
60
60
|
} else {
|
|
@@ -57,26 +57,26 @@ const display = computed(() => {
|
|
|
57
57
|
const start = new Date(props.start)
|
|
58
58
|
const end = new Date(props.end)
|
|
59
59
|
|
|
60
|
-
const start_day = String(start.
|
|
60
|
+
const start_day = String(start.getDate());
|
|
61
61
|
let start_day_suffix = suffix[start_day.slice(start_day.length - 1)] || 'th';
|
|
62
62
|
if (['11', '12', '13'].includes(start_day)) start_day_suffix = 'th';
|
|
63
|
-
const end_day = String(end.
|
|
63
|
+
const end_day = String(end.getDate());
|
|
64
64
|
let end_day_suffix = suffix[end_day.slice(end_day.length - 1)] || 'th';
|
|
65
65
|
if (['11', '12', '13'].includes(end_day)) end_day_suffix = 'th';
|
|
66
66
|
|
|
67
|
-
const start_month = `${months[start.
|
|
68
|
-
const end_month = `${months[end.
|
|
69
|
-
const start_time = `${String(start.
|
|
70
|
-
const end_time = `${String(end.
|
|
67
|
+
const start_month = `${months[start.getMonth()]} ${start.getDate()}${start_day_suffix}`;
|
|
68
|
+
const end_month = `${months[end.getMonth()]} ${end.getDate()}${end_day_suffix}`;
|
|
69
|
+
const start_time = `${String(start.getHours()).padStart(2, '0')}:${String(start.getMinutes()).padStart(2, '0')}`;
|
|
70
|
+
const end_time = `${String(end.getHours()).padStart(2, '0')}:${String(end.getMinutes()).padStart(2, '0')}`;
|
|
71
71
|
|
|
72
72
|
if (start.getFullYear() === end.getFullYear() && start.getFullYear() === new Date().getFullYear()) {
|
|
73
|
-
if (start.
|
|
73
|
+
if (start.getMonth() === end.getMonth() && start.getDate() === end.getDate()) {
|
|
74
74
|
return `${start_month} ${start_time} - ${end_time}`;
|
|
75
75
|
} else {
|
|
76
76
|
return `${start_month} ${start_time} - ${end_month} ${end_time}`;
|
|
77
77
|
}
|
|
78
78
|
} else if (start.getFullYear() === end.getFullYear()) {
|
|
79
|
-
if (start.
|
|
79
|
+
if (start.getMonth() === end.getMonth() && start.getDate() === end.getDate()) {
|
|
80
80
|
return `${start_month}, ${start.getFullYear()} ${start_time} - ${end_time}`;
|
|
81
81
|
} else {
|
|
82
82
|
return `${start_month}, ${start.getFullYear()} ${start_time} - ${end_month} ${end_time}`;
|