2023-07-17 19:11:13 +00:00
|
|
|
<script setup>
|
|
|
|
const { path } = useRoute()
|
|
|
|
|
|
|
|
const { data, error } = await useAsyncData(`content-${path}`, () => {
|
|
|
|
return queryContent().where({ _path: path }).findOne()
|
|
|
|
})
|
|
|
|
|
|
|
|
if (error.value) {
|
|
|
|
showError(
|
|
|
|
createError({
|
|
|
|
statusCode: 404,
|
|
|
|
statusMessage: 'Not Found',
|
|
|
|
})
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-01-16 05:12:01 +00:00
|
|
|
import { format } from "date-fns";
|
2023-07-17 19:11:13 +00:00
|
|
|
|
2024-01-16 05:12:01 +00:00
|
|
|
let formatDate = (date) => {
|
|
|
|
date = new Date(date)
|
|
|
|
return new Date(
|
|
|
|
date.valueOf() + date.getTimezoneOffset() * 60 * 1000
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
let date = formatDate(data.value.date)
|
|
|
|
data.value.date = format(date, 'EEE, MMMM do')
|
2023-07-17 19:11:13 +00:00
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="event" :id="data.slug">
|
|
|
|
<div class="hero">
|
|
|
|
<h3>{{ data.title }}</h3>
|
2023-08-11 18:50:24 +00:00
|
|
|
<h4><b>Location</b>: {{ data.location}}</h4>
|
|
|
|
<h4><b>Address</b>: {{ data.address }}</h4>
|
|
|
|
<h4><b>Date</b>: {{ data.date }} · {{ data.time }}</h4>
|
2023-07-17 19:11:13 +00:00
|
|
|
</div>
|
2023-08-11 18:50:24 +00:00
|
|
|
<ContentDoc class="details" />
|
2023-07-17 19:11:13 +00:00
|
|
|
</div>
|
|
|
|
</template>
|