@tak-ps/vue-tabler 3.8.2 → 3.8.3

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,10 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v3.8.3
14
+
15
+ - :bug: Fix suffixes on `11th`, `12th`, `13th` because english is lawless
16
+
13
17
  ### v3.8.2
14
18
 
15
19
  - :rocket: Minimize default Dropdown styling
@@ -48,7 +48,8 @@ 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
54
  const res = `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padEnd(2, '0')}, ${this.months[date.getUTCMonth()]} ${date.getUTCDate()}${suffix}`;
54
55
  if (date.getFullYear() === new Date().getFullYear()) {
@@ -60,9 +60,11 @@ 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}`;
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.3",
5
5
  "lib": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",