chore: standardize chrono provider
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -41,25 +41,25 @@ const popupStyle = computed(() => {
|
||||
})
|
||||
|
||||
const hasLocation = computed(() => {
|
||||
return props.event?.data?.locationsPhysical && Object.keys(props.event.data.locationsPhysical).length > 0 ||
|
||||
props.event?.data?.locationsVirtual && Object.keys(props.event.data.locationsVirtual).length > 0
|
||||
return props.event?.properties?.locationsPhysical && Object.keys(props.event.properties.locationsPhysical).length > 0 ||
|
||||
props.event?.properties?.locationsVirtual && Object.keys(props.event.properties.locationsVirtual).length > 0
|
||||
})
|
||||
|
||||
const firstLocation = computed(() => {
|
||||
if (props.event?.data?.locationsPhysical && Object.keys(props.event.data.locationsPhysical).length > 0) {
|
||||
const key = Object.keys(props.event.data.locationsPhysical)[0]
|
||||
return props.event.data.locationsPhysical[key]
|
||||
if (props.event?.properties?.locationsPhysical && Object.keys(props.event.properties.locationsPhysical).length > 0) {
|
||||
const key = Object.keys(props.event.properties.locationsPhysical)[0]
|
||||
return props.event.properties.locationsPhysical[key]
|
||||
}
|
||||
if (props.event?.data?.locationsVirtual && Object.keys(props.event.data.locationsVirtual).length > 0) {
|
||||
const key = Object.keys(props.event.data.locationsVirtual)[0]
|
||||
return props.event.data.locationsVirtual[key]
|
||||
if (props.event?.properties?.locationsVirtual && Object.keys(props.event.properties.locationsVirtual).length > 0) {
|
||||
const key = Object.keys(props.event.properties.locationsVirtual)[0]
|
||||
return props.event.properties.locationsVirtual[key]
|
||||
}
|
||||
return null
|
||||
})
|
||||
|
||||
const participantCount = computed(() => {
|
||||
if (!props.event?.data?.participants) return 0
|
||||
return Object.keys(props.event.data.participants).length
|
||||
if (!props.event?.properties?.participants) return 0
|
||||
return Object.keys(props.event.properties.participants).length
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -75,18 +75,18 @@ const participantCount = computed(() => {
|
||||
<v-card-text class="pa-3">
|
||||
<div class="d-flex align-center mb-2">
|
||||
<v-icon icon="mdi-calendar" size="small" class="mr-2" />
|
||||
<div class="text-subtitle-1 font-weight-bold">{{ event.data?.label || 'Untitled Event' }}</div>
|
||||
<div class="text-subtitle-1 font-weight-bold">{{ event.properties?.label || 'Untitled Event' }}</div>
|
||||
</div>
|
||||
|
||||
<div class="event-popup-details">
|
||||
<div class="d-flex align-center mb-1">
|
||||
<v-icon icon="mdi-clock-outline" size="small" class="mr-2 text-grey" />
|
||||
<div class="text-caption">
|
||||
<div v-if="event.data?.timeless">
|
||||
All Day - {{ new Date(event.data.startsOn).toLocaleDateString() }}
|
||||
<div v-if="event.properties?.timeless">
|
||||
All Day - {{ new Date(event.properties.startsOn).toLocaleDateString() }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ formatTime(event.data?.startsOn) }} - {{ formatTime(event.data?.endsOn) }}
|
||||
{{ formatTime(event.properties?.startsOn) }} - {{ formatTime(event.properties?.endsOn) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -98,10 +98,10 @@ const participantCount = computed(() => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="event.data?.organizer" class="d-flex align-center mb-1">
|
||||
<div v-if="event.properties?.organizer" class="d-flex align-center mb-1">
|
||||
<v-icon icon="mdi-account" size="small" class="mr-2 text-grey" />
|
||||
<div class="text-caption">
|
||||
{{ event.data.organizer.name || event.data.organizer.address }}
|
||||
{{ event.properties.organizer.name || event.properties.organizer.address }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -112,13 +112,13 @@ const participantCount = computed(() => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="event.data?.description" class="mt-2 pt-2 border-t">
|
||||
<div class="text-caption text-grey">{{ event.data.description }}</div>
|
||||
<div v-if="event.properties?.description" class="mt-2 pt-2 border-t">
|
||||
<div class="text-caption text-grey">{{ event.properties.description }}</div>
|
||||
</div>
|
||||
|
||||
<div v-if="event.data?.tags && event.data.tags.length > 0" class="mt-2">
|
||||
<div v-if="event.properties?.tags && event.properties.tags.length > 0" class="mt-2">
|
||||
<v-chip
|
||||
v-for="(tag, index) in event.data.tags.slice(0, 3)"
|
||||
v-for="(tag, index) in event.properties.tags.slice(0, 3)"
|
||||
:key="index"
|
||||
size="x-small"
|
||||
class="mr-1"
|
||||
@@ -126,8 +126,8 @@ const participantCount = computed(() => {
|
||||
>
|
||||
{{ tag }}
|
||||
</v-chip>
|
||||
<span v-if="event.data.tags.length > 3" class="text-caption text-grey">
|
||||
+{{ event.data.tags.length - 3 }} more
|
||||
<span v-if="event.properties.tags.length > 3" class="text-caption text-grey">
|
||||
+{{ event.properties.tags.length - 3 }} more
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user