@explorer-1/vue 0.2.6 → 0.2.7
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/dist/explorer-1-vue.js +2612 -2556
- package/dist/explorer-1-vue.umd.cjs +14 -12
- package/dist/src/components/CalendarButton/CalendarButton.vue.d.ts +3 -2
- package/dist/src/components/EventCard/EventCard.vue.d.ts +9 -4
- package/dist/src/components/EventDetailHero/EventDetailHero.vue.d.ts +11 -0
- package/dist/src/components/NavDesktopEdu/NavDesktopEdu.stories.d.ts +58 -11
- package/dist/src/templates/edu/PageEduEventDetail/PageEduEventDetail.stories.d.ts +57 -29
- package/dist/src/utils/mixins.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/BaseButton/BaseButton.vue +1 -1
- package/src/components/BaseImage/BaseImage.vue +1 -1
- package/src/components/BaseTag/BaseTag.vue +2 -2
- package/src/components/BlockIframeEmbed/BlockIframeEmbed.vue +3 -2
- package/src/components/BlockImage/BlockImageStandard.vue +1 -1
- package/src/components/BlockKeyPoints/BlockKeyPoints.vue +2 -2
- package/src/components/BlockLinkCard/BlockLinkCard.vue +1 -0
- package/src/components/BlockRelatedLinks/BlockRelatedLinks.vue +29 -27
- package/src/components/BlockRelatedLinks/RelatedLink.vue +3 -3
- package/src/components/BlockVideo/BlockVideo.vue +1 -1
- package/src/components/BlockVideoEmbed/BlockVideoEmbed.vue +1 -1
- package/src/components/CalendarButton/CalendarButton.vue +9 -10
- package/src/components/EventCard/EventCard.vue +22 -8
- package/src/components/EventDetailHero/EventDetailHero.vue +45 -21
- package/src/components/HeroMedia/HeroMedia.vue +2 -2
- package/src/components/MixinCarousel/MixinCarousel.vue +2 -2
- package/src/components/NavDesktopEdu/NavDesktopEdu.vue +11 -1
- package/src/components/NavMobile/NavMobile.vue +19 -10
- package/src/components/ShareButtons/ShareButtons.vue +1 -1
- package/src/components/ShareButtonsEdu/ShareButtonsEdu.vue +1 -1
- package/src/components/TheFooter/TheFooter.vue +3 -1
- package/src/templates/PageEventDetail/PageEventDetail.vue +2 -1
- package/src/templates/PageNewsDetail/PageNewsDetail.vue +3 -1
- package/src/templates/edu/PageEduEventDetail/PageEduEventDetail.stories.js +146 -104
- package/src/templates/edu/PageEduEventDetail/PageEduEventDetail.vue +101 -50
- package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue +1 -1
- package/src/utils/mixins.ts +18 -14
- package/tsconfig.json +1 -1
package/src/utils/mixins.ts
CHANGED
|
@@ -57,6 +57,8 @@ export type lightboxGalleryObject = {
|
|
|
57
57
|
|
|
58
58
|
export interface EventDateObject {
|
|
59
59
|
day: string
|
|
60
|
+
month: string
|
|
61
|
+
year: string
|
|
60
62
|
monthAndYear: string
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -285,6 +287,8 @@ export const mixinFormatSplitEventDates = (
|
|
|
285
287
|
const startDateDayjs = dayjs(startDatetime)
|
|
286
288
|
|
|
287
289
|
let day = startDateDayjs.format('D')
|
|
290
|
+
const month = startDateDayjs.format('MMM').replace('.', '')
|
|
291
|
+
const year = startDateDayjs.format('YYYY')
|
|
288
292
|
const monthAndYear = startDateDayjs.format('MMM YYYY')
|
|
289
293
|
|
|
290
294
|
if (endDatetime) {
|
|
@@ -299,7 +303,7 @@ export const mixinFormatSplitEventDates = (
|
|
|
299
303
|
}
|
|
300
304
|
// Otherwise, we only show the start date
|
|
301
305
|
}
|
|
302
|
-
return { day, monthAndYear }
|
|
306
|
+
return { day, month, year, monthAndYear }
|
|
303
307
|
}
|
|
304
308
|
|
|
305
309
|
// return event dates formatted for listing cards
|
|
@@ -335,27 +339,27 @@ export const mixinFormatEventTimeInHoursAndMinutes = (
|
|
|
335
339
|
endDatetime?: string,
|
|
336
340
|
endTime?: string
|
|
337
341
|
): string => {
|
|
338
|
-
// Only display time if event spans less than one day
|
|
339
342
|
const startDateDayjs = dayjs(startDatetime)
|
|
340
343
|
let time = ''
|
|
341
344
|
|
|
342
345
|
if (endDatetime) {
|
|
343
346
|
const endDateDayjs = dayjs(endDatetime)
|
|
344
|
-
if
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
)
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
time = `${startDateDayjs.format('h:mm a')} - ${endDateDayjs.format('h:mm a z')}`
|
|
354
|
-
}
|
|
347
|
+
// Only display time if event spans less than one day
|
|
348
|
+
// if (
|
|
349
|
+
// endDateDayjs.diff(startDateDayjs, 'hour') <= 24 &&
|
|
350
|
+
// endDateDayjs.diff(startDateDayjs, 'day') === 0
|
|
351
|
+
// ) {
|
|
352
|
+
// Event is less than 24 hours and spans 1 day
|
|
353
|
+
if (endTime) {
|
|
354
|
+
if (startDateDayjs.format('a') === endDateDayjs.format('a')) {
|
|
355
|
+
time = `${startDateDayjs.format('h:mm')} - ${endDateDayjs.format('h:mm a z')}`
|
|
355
356
|
} else {
|
|
356
|
-
time = `${startDateDayjs.format('h:mm a z')}`
|
|
357
|
+
time = `${startDateDayjs.format('h:mm a')} - ${endDateDayjs.format('h:mm a z')}`
|
|
357
358
|
}
|
|
359
|
+
} else {
|
|
360
|
+
time = `${startDateDayjs.format('h:mm a z')}`
|
|
358
361
|
}
|
|
362
|
+
// }
|
|
359
363
|
}
|
|
360
364
|
return time
|
|
361
365
|
}
|