@asd20/ui 3.2.813 → 3.2.815
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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
:style="{ '--accent-color': event.calendarColor }"
|
|
8
8
|
>
|
|
9
9
|
<span class="title"
|
|
10
|
-
><span>{{
|
|
10
|
+
><span>{{ sanitizedSummary }}</span></span
|
|
11
11
|
>
|
|
12
12
|
<span class="time">{{ start }}{{ end }}</span>
|
|
13
13
|
<span class="start-time">{{ startTime }}</span>
|
|
@@ -36,20 +36,43 @@ export default {
|
|
|
36
36
|
this.event.allday || this.event.multiDay,
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
|
|
40
39
|
startTime() {
|
|
41
|
-
return format(
|
|
40
|
+
return format(
|
|
41
|
+
parse(this.event.start, "yyyy-MM-dd'T'HH:mm:ssX", new Date()),
|
|
42
|
+
'h:mm aa'
|
|
43
|
+
)
|
|
42
44
|
},
|
|
43
45
|
start() {
|
|
44
|
-
return format(
|
|
46
|
+
return format(
|
|
47
|
+
parse(this.event.start, "yyyy-MM-dd'T'HH:mm:ssX", new Date()),
|
|
48
|
+
'h:mm aa, MMMM DD YYYY'
|
|
49
|
+
)
|
|
45
50
|
},
|
|
46
51
|
end() {
|
|
47
|
-
return
|
|
52
|
+
return (
|
|
53
|
+
' to ' +
|
|
54
|
+
format(
|
|
55
|
+
parse(this.event.end, "yyyy-MM-dd'T'HH:mm:ssX", new Date()),
|
|
56
|
+
'h:mm aa, MMMM DD YYYY'
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
},
|
|
60
|
+
sanitizedSummary() {
|
|
61
|
+
return this.sanitizeSummary(this.event.summary)
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
methods: {
|
|
65
|
+
// specifically for rSchool events that have extraneous school names in the summary
|
|
66
|
+
sanitizeSummary(summary) {
|
|
67
|
+
if (!summary) return summary
|
|
68
|
+
const pattern = /vs\.[^>]*>Multiple Schools/
|
|
69
|
+
return summary.replace(pattern, 'vs. Multiple Schools')
|
|
48
70
|
},
|
|
49
71
|
},
|
|
50
72
|
}
|
|
51
73
|
</script>
|
|
52
74
|
|
|
75
|
+
|
|
53
76
|
<style lang="scss" scoped>
|
|
54
77
|
@import '../../../design/_mixins.scss';
|
|
55
78
|
@import '../../../design/_variables.scss';
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<asd20-modal
|
|
3
3
|
v-if="event"
|
|
4
4
|
:open="open"
|
|
5
|
-
:title="
|
|
5
|
+
:title="
|
|
6
|
+
`${event.calendarOrganizationTitle || event.calendarLocation} Event`
|
|
7
|
+
"
|
|
6
8
|
icon="calendar-alt"
|
|
7
9
|
dismissable
|
|
8
10
|
class="asd20-event-modal"
|
|
@@ -127,18 +129,24 @@ export default {
|
|
|
127
129
|
sanitizeDescription(description) {
|
|
128
130
|
if (!description) return description
|
|
129
131
|
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
+
// Check if the description contains ">Multiple Schools"
|
|
133
|
+
if (description.includes('>Multiple Schools')) {
|
|
134
|
+
// Remove text between the ">" backwards to the first "." or ":" and replace '>Multiple Schools' with '.'
|
|
135
|
+
description = description.replace(
|
|
136
|
+
/([.:][^>]*?)>([^>]*Multiple Schools)/,
|
|
137
|
+
'$1.'
|
|
138
|
+
)
|
|
132
139
|
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
// Separate capital letters preceded by lowercase letters with ', '
|
|
141
|
+
description = description.replace(/([a-z])([A-Z])/g, '$1, $2')
|
|
135
142
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
143
|
+
// Remove unmatched quotes between "." or ":" and ">"
|
|
144
|
+
const quotePattern = /[.:][^>]*['"][^'"]*$|[^'"]*['"][^>]*['"]>Multiple Schools/g
|
|
145
|
+
description = description.replace(quotePattern, match => {
|
|
146
|
+
const quotes = match.match(/['"]/g) || []
|
|
147
|
+
return quotes.length % 2 !== 0 ? match.replace(/['"]/g, '') : match
|
|
148
|
+
})
|
|
149
|
+
}
|
|
142
150
|
|
|
143
151
|
return description
|
|
144
152
|
},
|
|
@@ -13,18 +13,24 @@ const sanitizeSummary = summary => {
|
|
|
13
13
|
const sanitizeDescription = description => {
|
|
14
14
|
if (!description) return description
|
|
15
15
|
|
|
16
|
-
//
|
|
17
|
-
|
|
16
|
+
// Check if the description contains ">Multiple Schools"
|
|
17
|
+
if (description.includes('>Multiple Schools')) {
|
|
18
|
+
// Remove text between the ">" backwards to the first "." or ":" and replace '>Multiple Schools' with '.'
|
|
19
|
+
description = description.replace(
|
|
20
|
+
/([.:][^>]*?)>([^>]*Multiple Schools)/,
|
|
21
|
+
'$1.'
|
|
22
|
+
)
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
// Separate capital letters preceded by lowercase letters with ', '
|
|
25
|
+
description = description.replace(/([a-z])([A-Z])/g, '$1, $2')
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
// Remove unmatched quotes between "." or ":" and ">"
|
|
28
|
+
const quotePattern = /[.:][^>]*['"][^'"]*$|[^'"]*['"][^>]*['"]>Multiple Schools/g
|
|
29
|
+
description = description.replace(quotePattern, match => {
|
|
30
|
+
const quotes = match.match(/['"]/g) || []
|
|
31
|
+
return quotes.length % 2 !== 0 ? match.replace(/['"]/g, '') : match
|
|
32
|
+
})
|
|
33
|
+
}
|
|
28
34
|
|
|
29
35
|
return description
|
|
30
36
|
}
|
|
@@ -52,7 +58,10 @@ const formattedTime = event => {
|
|
|
52
58
|
const endTime = parse(event.end, "yyyy-MM-dd'T'HH:mm:ssX", new Date())
|
|
53
59
|
const startHour = startTime.getHours()
|
|
54
60
|
|
|
55
|
-
if (
|
|
61
|
+
if (
|
|
62
|
+
startTime.getTime() === endTime.getTime() &&
|
|
63
|
+
(startHour >= 23 || startHour < 3)
|
|
64
|
+
) {
|
|
56
65
|
return 'TBD'
|
|
57
66
|
}
|
|
58
67
|
|