@asd20/ui 3.2.811 → 3.2.812
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
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
<asd20-modal
|
|
3
3
|
v-if="event"
|
|
4
4
|
:open="open"
|
|
5
|
-
:title="
|
|
6
|
-
`${event.calendarOrganizationTitle || event.calendarLocation} Event`
|
|
7
|
-
"
|
|
5
|
+
:title="`${event.calendarOrganizationTitle || event.calendarLocation} Event`"
|
|
8
6
|
icon="calendar-alt"
|
|
9
7
|
dismissable
|
|
10
8
|
class="asd20-event-modal"
|
|
@@ -23,7 +21,7 @@
|
|
|
23
21
|
</header>
|
|
24
22
|
<Asd20List class="description">
|
|
25
23
|
<Asd20ListItem
|
|
26
|
-
v-if="time"
|
|
24
|
+
v-if="time !== null"
|
|
27
25
|
icon="hours-alt"
|
|
28
26
|
icon-size="lg"
|
|
29
27
|
label="Time"
|
|
@@ -55,18 +53,12 @@
|
|
|
55
53
|
</template>
|
|
56
54
|
|
|
57
55
|
<script>
|
|
58
|
-
// import parse from 'date-fns/parse'
|
|
59
|
-
// import Vue from 'vue'
|
|
60
|
-
|
|
61
|
-
import { truncate } from 'lodash-es'
|
|
62
56
|
import { format, parse } from 'date-fns'
|
|
63
57
|
import Asd20Modal from '../../molecules/Asd20Modal'
|
|
64
58
|
import Asd20Tag from '../../atoms/Asd20Tag'
|
|
65
59
|
import Asd20List from '../../organisms/Asd20List'
|
|
66
60
|
import Asd20ListItem from '../../molecules/Asd20ListItem'
|
|
67
61
|
import Asd20Viewport from '../../atoms/Asd20Viewport'
|
|
68
|
-
// import VScrollLock from 'v-scroll-lock'
|
|
69
|
-
// Vue.use(VScrollLock)
|
|
70
62
|
|
|
71
63
|
export default {
|
|
72
64
|
name: 'Asd20EventModal',
|
|
@@ -81,32 +73,37 @@ export default {
|
|
|
81
73
|
},
|
|
82
74
|
|
|
83
75
|
time() {
|
|
84
|
-
if (!this.event) return
|
|
76
|
+
if (!this.event) return null
|
|
85
77
|
|
|
86
|
-
|
|
78
|
+
const startTime = parse(this.event.start, "yyyy-MM-dd'T'HH:mm:ssX", new Date())
|
|
79
|
+
const endTime = parse(this.event.end, "yyyy-MM-dd'T'HH:mm:ssX", new Date())
|
|
87
80
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
)}<br>ending ${format(
|
|
93
|
-
parse(this.event.end),
|
|
94
|
-
'<b>h:mm aa</b>, dddd, MMMM DD, YYYY'
|
|
95
|
-
)}`
|
|
81
|
+
const startHour = startTime.getHours()
|
|
82
|
+
// Display 'TBD' if start time is the same as end time and falls between 11 PM and 3 AM
|
|
83
|
+
if (startTime.getTime() === endTime.getTime() && (startHour >= 23 || startHour < 3)) {
|
|
84
|
+
return 'TBD'
|
|
96
85
|
}
|
|
97
86
|
|
|
98
|
-
let time = `${format(
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
let time = `${format(startTime, '<b>h:mm aa</b>').replace(/:00/g, '')}`
|
|
88
|
+
|
|
89
|
+
// Check if end time is the same as start time
|
|
90
|
+
if (startTime.getTime() === endTime.getTime()) {
|
|
91
|
+
time += '' // No end time needed if they are the same
|
|
92
|
+
} else if (this.event.endTimeUndetermined) {
|
|
93
|
+
time += `${format(endTime).replace(/:00/g, '')}`
|
|
101
94
|
} else {
|
|
102
|
-
time += ` - ${format(
|
|
95
|
+
time += ` - ${format(endTime, '<b>h:mm aa</b>')
|
|
96
|
+
.replace(/#/g, ' ')
|
|
97
|
+
.replace(/:00/g, '')}`
|
|
103
98
|
}
|
|
99
|
+
|
|
104
100
|
return time
|
|
105
101
|
},
|
|
106
102
|
},
|
|
107
103
|
}
|
|
108
104
|
</script>
|
|
109
105
|
|
|
106
|
+
|
|
110
107
|
<style lang="scss" scoped>
|
|
111
108
|
@import '../../../design/_mixins.scss';
|
|
112
109
|
@import '../../../design/_variables.scss';
|