@asd20/ui 3.2.956 → 3.2.958
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/package.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:href="event.url"
|
|
6
6
|
target="_blank"
|
|
7
7
|
:style="{ '--accent-color': event.calendarColor }"
|
|
8
|
+
:aria-label="computedAriaLabel"
|
|
8
9
|
>
|
|
9
10
|
<span class="title">
|
|
10
11
|
<span class="dot" :style="{ backgroundColor: event.calendarColor }"></span>
|
|
@@ -78,6 +79,27 @@ export default {
|
|
|
78
79
|
const pattern = /vs\.[^>]*>Multiple Schools/
|
|
79
80
|
return summary.replace(pattern, 'vs. Multiple Schools')
|
|
80
81
|
},
|
|
82
|
+
computedAriaLabel() {
|
|
83
|
+
if (!this.event) return ''
|
|
84
|
+
|
|
85
|
+
const summary = this.sanitizedSummary || 'Event'
|
|
86
|
+
|
|
87
|
+
const startDate = this.formatDate(this.event.originalStart || this.event.start)
|
|
88
|
+
let endDate = this.event.end ? this.formatDate(this.event.end) : null
|
|
89
|
+
|
|
90
|
+
// For all-day or multi-day events, subtract a day from end
|
|
91
|
+
if ((this.event.allDay || this.event.multiDay) && endDate) {
|
|
92
|
+
const end = new Date(this.event.end)
|
|
93
|
+
end.setDate(end.getDate() - 1)
|
|
94
|
+
endDate = this.formatDate(end)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!endDate || startDate === endDate) {
|
|
98
|
+
return `${summary}, ${startDate}`
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return `${summary}, ${startDate} - ${endDate}`
|
|
102
|
+
},
|
|
81
103
|
},
|
|
82
104
|
}
|
|
83
105
|
|