@tak-ps/vue-tabler 3.8.2 → 3.8.4

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 CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v3.8.4
14
+
15
+ - :bug: Be consistent with using UTC Hours for now
16
+
17
+ ### v3.8.3
18
+
19
+ - :bug: Fix suffixes on `11th`, `12th`, `13th` because english is lawless
20
+
13
21
  ### v3.8.2
14
22
 
15
23
  - :rocket: Minimize default Dropdown styling
@@ -48,9 +48,10 @@ export default {
48
48
  .replace(/:[0-9]+\.[0-9]+[A-Z]/, '');
49
49
  } else if (this.format === 'Human') {
50
50
  const day = String(date.getUTCDate());
51
- const suffix = this.suffix[day.slice(day.length - 1)] || 'th';
51
+ let suffix = this.suffix[day.slice(day.length - 1)] || 'th';
52
+ if (['11', '12', '13'].includes(day)) suffix = 'th';
52
53
 
53
- const res = `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padEnd(2, '0')}, ${this.months[date.getUTCMonth()]} ${date.getUTCDate()}${suffix}`;
54
+ const res = `${String(date.getUTCHours()).padStart(2, '0')}:${String(date.getMinutes()).padEnd(2, '0')}, ${this.months[date.getUTCMonth()]} ${date.getUTCDate()}${suffix}`;
54
55
  if (date.getFullYear() === new Date().getFullYear()) {
55
56
  return res;
56
57
  } else {
@@ -60,14 +60,16 @@ export default {
60
60
  const end = new Date(this.end)
61
61
 
62
62
  const start_day = String(start.getUTCDate());
63
- const start_day_suffix = this.suffix[start_day.slice(start_day.length - 1)] || 'th';
63
+ let start_day_suffix = this.suffix[start_day.slice(start_day.length - 1)] || 'th';
64
+ if (['11', '12', '13'].includes(start_day)) start_day_suffix = 'th';
64
65
  const end_day = String(end.getUTCDate());
65
- const end_day_suffix = this.suffix[end_day.slice(end_day.length - 1)] || 'th';
66
+ let end_day_suffix = this.suffix[end_day.slice(end_day.length - 1)] || 'th';
67
+ if (['11', '12', '13'].includes(end_day)) end_day_suffix = 'th';
66
68
 
67
69
  const start_month = `${this.months[start.getUTCMonth()]} ${start.getUTCDate()}${start_day_suffix}`;
68
70
  const end_month = `${this.months[end.getUTCMonth()]} ${end.getUTCDate()}${end_day_suffix}`;
69
- const start_time = `${String(start.getHours()).padStart(2, '0')}:${String(start.getMinutes()).padEnd(2, '0')}`;
70
- const end_time = `${String(end.getHours()).padStart(2, '0')}:${String(end.getMinutes()).padEnd(2, '0')}`;
71
+ const start_time = `${String(start.getUTCHours()).padStart(2, '0')}:${String(start.getMinutes()).padEnd(2, '0')}`;
72
+ const end_time = `${String(end.getUTCHours()).padStart(2, '0')}:${String(end.getMinutes()).padEnd(2, '0')}`;
71
73
 
72
74
  if (start.getFullYear() === end.getFullYear() && start.getFullYear() === new Date().getFullYear()) {
73
75
  if (start.getUTCMonth() === end.getUTCMonth() && start.getUTCDate() === end.getUTCDate()) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "3.8.2",
4
+ "version": "3.8.4",
5
5
  "lib": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",