forked from mirrors/homebox
fix datetime display issues (again) (#324)
This commit is contained in:
parent
025521431e
commit
cf536393f5
8 changed files with 46 additions and 14 deletions
|
@ -3,16 +3,18 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
type DateTimeFormat = "relative" | "long" | "short" | "human";
|
||||
import { DateTimeFormat, DateTimeType } from "~~/composables/use-formatters";
|
||||
|
||||
type Props = {
|
||||
date?: Date | string;
|
||||
format?: DateTimeFormat;
|
||||
datetimeType?: DateTimeType;
|
||||
};
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
date: undefined,
|
||||
format: "relative",
|
||||
datetimeType: "date",
|
||||
});
|
||||
|
||||
const value = computed(() => {
|
||||
|
@ -20,6 +22,6 @@
|
|||
return "";
|
||||
}
|
||||
|
||||
return fmtDate(props.date, props.format);
|
||||
return fmtDate(props.date, props.format, props.datetimeType);
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue