public/components/Date.vue

14 lines
420 B
Vue
Raw Normal View History

<script setup lang="ts">
import { getPrettyDate, getUtcDate } from "~~/shared/metadata";
import { BlogParsedContent, StoryParsedContent } from "~~/shared/types";
const props = defineProps<{ doc: StoryParsedContent | BlogParsedContent }>();
const prettyDate = getPrettyDate(props.doc);
const utcDate = getUtcDate(props.doc);
</script>
<template>
2022-12-02 01:06:07 -05:00
<time pubdate :datetime="utcDate">{{ prettyDate }}</time>
</template>