mirror of
https://github.com/hay-kot/homebox.git
synced 2024-12-01 21:15:42 +00:00
22 lines
422 B
Vue
22 lines
422 B
Vue
<template>
|
|
{{ value }}
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
type DateTimeFormat = "relative" | "long" | "short" | "human";
|
|
|
|
const props = defineProps({
|
|
date: {
|
|
type: [Date, String],
|
|
required: true,
|
|
},
|
|
format: {
|
|
type: String as () => DateTimeFormat,
|
|
default: "relative",
|
|
},
|
|
});
|
|
|
|
const value = computed(() => {
|
|
return fmtDate(props.date, props.format);
|
|
});
|
|
</script>
|