@explorer-1/vue 0.2.80 → 0.2.82
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 +1 -1
- package/src/components/HeroInlineMedia/HeroInlineMedia.vue +0 -1
- package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue +3 -5
- package/src/templates/edu/PageEduLesson/PageEduLesson.vue +3 -5
- package/src/templates/edu/PageEduStudentProject/PageEduStudentProject.vue +3 -5
- package/src/templates/edu/PageEduTeachableMoment/PageEduTeachableMoment.vue +3 -5
- package/src/utils/mixins.ts +23 -10
package/package.json
CHANGED
|
@@ -56,12 +56,9 @@ export default defineComponent({
|
|
|
56
56
|
return false
|
|
57
57
|
},
|
|
58
58
|
heroInline(): boolean {
|
|
59
|
-
// heroes with interactive elements have special handling
|
|
60
59
|
if (this.theHero && !this.heroTitle) {
|
|
61
|
-
//
|
|
62
|
-
if (
|
|
63
|
-
return false
|
|
64
|
-
} else if (
|
|
60
|
+
// heroes with interactive elements have special handling
|
|
61
|
+
if (
|
|
65
62
|
this.data?.heroPosition === 'inline' ||
|
|
66
63
|
this.theHero.blockType === 'CarouselBlock' ||
|
|
67
64
|
this.theHero.blockType === 'IframeEmbedBlock' ||
|
|
@@ -70,6 +67,7 @@ export default defineComponent({
|
|
|
70
67
|
) {
|
|
71
68
|
return true
|
|
72
69
|
}
|
|
70
|
+
return false
|
|
73
71
|
}
|
|
74
72
|
return false
|
|
75
73
|
},
|
|
@@ -113,12 +113,9 @@ const heroTitle = computed((): boolean => {
|
|
|
113
113
|
})
|
|
114
114
|
|
|
115
115
|
const heroInline = computed((): boolean => {
|
|
116
|
-
// heroes with interactive elements have special handling
|
|
117
116
|
if (theHero.value && !heroTitle.value) {
|
|
118
|
-
//
|
|
119
|
-
if (
|
|
120
|
-
return false
|
|
121
|
-
} else if (
|
|
117
|
+
// heroes with interactive elements have special handling
|
|
118
|
+
if (
|
|
122
119
|
data?.heroPosition === 'inline' ||
|
|
123
120
|
theHero.value.blockType === 'CarouselBlock' ||
|
|
124
121
|
theHero.value.blockType === 'IframeEmbedBlock' ||
|
|
@@ -127,6 +124,7 @@ const heroInline = computed((): boolean => {
|
|
|
127
124
|
) {
|
|
128
125
|
return true
|
|
129
126
|
}
|
|
127
|
+
return false
|
|
130
128
|
}
|
|
131
129
|
return false
|
|
132
130
|
})
|
|
@@ -92,12 +92,9 @@ const heroTitle = computed((): boolean => {
|
|
|
92
92
|
})
|
|
93
93
|
|
|
94
94
|
const heroInline = computed((): boolean => {
|
|
95
|
-
// heroes with interactive elements have special handling
|
|
96
95
|
if (theHero.value && !heroTitle.value) {
|
|
97
|
-
//
|
|
98
|
-
if (
|
|
99
|
-
return false
|
|
100
|
-
} else if (
|
|
96
|
+
// heroes with interactive elements have special handling
|
|
97
|
+
if (
|
|
101
98
|
data?.heroPosition === 'inline' ||
|
|
102
99
|
theHero.value.blockType === 'CarouselBlock' ||
|
|
103
100
|
theHero.value.blockType === 'IframeEmbedBlock' ||
|
|
@@ -106,6 +103,7 @@ const heroInline = computed((): boolean => {
|
|
|
106
103
|
) {
|
|
107
104
|
return true
|
|
108
105
|
}
|
|
106
|
+
return false
|
|
109
107
|
}
|
|
110
108
|
return false
|
|
111
109
|
})
|
|
@@ -52,12 +52,9 @@ const heroTitle = computed((): boolean => {
|
|
|
52
52
|
})
|
|
53
53
|
|
|
54
54
|
const heroInline = computed((): boolean => {
|
|
55
|
-
// heroes with interactive elements have special handling
|
|
56
55
|
if (theHero.value && !heroTitle.value) {
|
|
57
|
-
//
|
|
58
|
-
if (
|
|
59
|
-
return false
|
|
60
|
-
} else if (
|
|
56
|
+
// heroes with interactive elements have special handling
|
|
57
|
+
if (
|
|
61
58
|
data?.heroPosition === 'inline' ||
|
|
62
59
|
theHero.value.blockType === 'CarouselBlock' ||
|
|
63
60
|
theHero.value.blockType === 'IframeEmbedBlock' ||
|
|
@@ -66,6 +63,7 @@ const heroInline = computed((): boolean => {
|
|
|
66
63
|
) {
|
|
67
64
|
return true
|
|
68
65
|
}
|
|
66
|
+
return false
|
|
69
67
|
}
|
|
70
68
|
return false
|
|
71
69
|
})
|
package/src/utils/mixins.ts
CHANGED
|
@@ -293,20 +293,33 @@ export const mixinFormatSplitEventDates = (
|
|
|
293
293
|
endDatetime?: string,
|
|
294
294
|
compact?: boolean
|
|
295
295
|
): EventDateObject => {
|
|
296
|
-
const
|
|
296
|
+
const endDateDayjs = endDatetime ? dayjs(endDatetime) : undefined
|
|
297
297
|
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
298
|
+
const startDateDayjs = () => {
|
|
299
|
+
// use the end date if the event has started but hasn't ended
|
|
300
|
+
let date = startDatetime
|
|
301
|
+
const startDate = startDatetime ? dayjs(startDatetime) : undefined
|
|
302
|
+
if (startDatetime && endDatetime && endDateDayjs && startDate) {
|
|
303
|
+
let now = dayjs(new Date())
|
|
304
|
+
if (endDateDayjs > now && startDate < now) {
|
|
305
|
+
date = endDatetime
|
|
306
|
+
} else {
|
|
307
|
+
date = startDatetime
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return dayjs(date)
|
|
311
|
+
}
|
|
303
312
|
|
|
304
|
-
|
|
305
|
-
|
|
313
|
+
const monthFormat = compact ? 'MM' : 'MMM'
|
|
314
|
+
let day = startDateDayjs().format('D')
|
|
315
|
+
const month = startDateDayjs().format(monthFormat).replace('.', '')
|
|
316
|
+
const year = startDateDayjs().format('YYYY')
|
|
317
|
+
const monthAndYear = startDateDayjs().format(`${monthFormat} YYYY`)
|
|
306
318
|
|
|
319
|
+
if (endDateDayjs) {
|
|
307
320
|
if (
|
|
308
|
-
startDateDayjs.format('MM') === endDateDayjs.format('MM') &&
|
|
309
|
-
startDateDayjs.format('ll') !== endDateDayjs.format('ll')
|
|
321
|
+
startDateDayjs().format('MM') === endDateDayjs.format('MM') &&
|
|
322
|
+
startDateDayjs().format('ll') !== endDateDayjs.format('ll')
|
|
310
323
|
) {
|
|
311
324
|
// If event spans multiple days within the same month, show both days
|
|
312
325
|
day = `${day}-${endDateDayjs.format('D')}`
|