Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
<script setup lang="ts">
import { computed } from "vue";
import dayjs from "dayjs";
import { useI18n } from "vue-i18n";

const props = defineProps<{ date: string; format: string }>();
const { locale } = useI18n();

const humanDate = computed(() => dayjs(props.date).format(props.format));
const humanDate = computed(() =>
dayjs(props.date).locale(locale.value).format(props.format),
);
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
<script setup lang="ts">
import { computed } from "vue";
import dayjs from "dayjs";
import { useI18n } from "vue-i18n";

const props = defineProps<{ date: string }>();
const { locale } = useI18n();

const humanTimespan = computed(() => dayjs(props.date).fromNow());
const humanTimespan = computed(() =>
dayjs(props.date).locale(locale.value).fromNow(),
);
</script>
1 change: 1 addition & 0 deletions frontend/DM.Web.Modern.Temp/src/stores/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ref } from "vue";
import { ColorSchema } from "@/api/models/community";
import { useUserStore } from "@/stores/user";
import i18n from "@/i18n";
import dayjs from "dayjs";

export const useUiStore = defineStore("ui", () => {
const theme = ref(ColorSchema.Modern);
Expand Down