@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
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.813",
8
+ "version": "3.2.815",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -7,7 +7,7 @@
7
7
  :style="{ '--accent-color': event.calendarColor }"
8
8
  >
9
9
  <span class="title"
10
- ><span>{{ event.summary }}</span></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(parse(this.event.start), 'h:mm aa')
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(parse(this.event.start), 'h:mm aa, MMMM DD YYYY')
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 ' to ' + format(parse(this.event.end), 'h:mm aa, MMMM DD YYYY')
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="`${event.calendarOrganizationTitle || event.calendarLocation} Event`"
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
- // Remove text between the ">" backwards to the first "." or ":" and replace '>Multiple Schools' with '.'
131
- description = description.replace(/([.:][^>]*?)>([^>]*Multiple Schools)/, '$1.')
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
- // Separate capital letters preceded by lowercase letters with ', '
134
- description = description.replace(/([a-z])([A-Z])/g, '$1, $2')
140
+ // Separate capital letters preceded by lowercase letters with ', '
141
+ description = description.replace(/([a-z])([A-Z])/g, '$1, $2')
135
142
 
136
- // Remove unmatched quotes between "." or ":" and ">"
137
- const quotePattern = /[.:][^>]*['"][^'"]*$|[^'"]*['"][^>]*['"]>Multiple Schools/g
138
- description = description.replace(quotePattern, match => {
139
- const quotes = match.match(/['"]/g) || []
140
- return quotes.length % 2 !== 0 ? match.replace(/['"]/g, '') : match
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
- // Remove text between the ">" backwards to the first "." or ":"
17
- description = description.replace(/([.:][^>]*?)>([^>]*Multiple Schools)/, '$1>$2')
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
- // Separate capital letters preceded by lowercase letters with ', '
20
- description = description.replace(/([a-z])([A-Z])/g, '$1, $2')
24
+ // Separate capital letters preceded by lowercase letters with ', '
25
+ description = description.replace(/([a-z])([A-Z])/g, '$1, $2')
21
26
 
22
- // Remove unmatched quotes between "." or ":" and ">"
23
- const quotePattern = /[.:][^>]*['"][^'"]*$|[^'"]*['"][^>]*['"]>Multiple Schools/g
24
- description = description.replace(quotePattern, match => {
25
- const quotes = match.match(/['"]/g) || []
26
- return quotes.length % 2 !== 0 ? match.replace(/['"]/g, '') : match
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 (startTime.getTime() === endTime.getTime() && (startHour >= 23 || startHour < 3)) {
61
+ if (
62
+ startTime.getTime() === endTime.getTime() &&
63
+ (startHour >= 23 || startHour < 3)
64
+ ) {
56
65
  return 'TBD'
57
66
  }
58
67