Skip to content

Commit 74f2db0

Browse files
committed
fix: use selected kanri locale to format date strings instead of system locale
1 parent 42c349a commit 74f2db0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

components/kanban/Card.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ const emit = defineEmits<{
205205
(e: "duplicateCard", cardId: string | undefined): void;
206206
}>();
207207
208+
const { locale } = useI18n();
209+
208210
const globalSettingsStore = useSettingsStore();
209211
const themeStore = useThemeStore();
210212
@@ -427,7 +429,7 @@ const getFormattedDueDate = computed(() => {
427429
}
428430
}
429431
430-
return new Date(dueDate.value).toLocaleDateString();
432+
return new Date(dueDate.value).toLocaleDateString(locale.value);
431433
});
432434
433435
const dueDateOverdue = computed(() => {

components/modal/EditCard.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ const emit = defineEmits<{
550550
(e: "openTagEdit"): void;
551551
}>();
552552
553+
const { locale } = useI18n();
554+
553555
const columnID = ref("");
554556
const { textarea: titleTextArea, input: title } = useTextareaAutosize();
555557
const description = ref("");
@@ -776,9 +778,9 @@ const setCardColor = (
776778
777779
const dateToLocalFormat = (date: Date | string) => {
778780
if (typeof date === "string") {
779-
return new Date(date).toLocaleDateString();
781+
return new Date(date).toLocaleDateString(locale.value);
780782
}
781-
return date.toLocaleDateString();
783+
return date.toLocaleDateString(locale.value);
782784
};
783785
784786
watch(customColor, (newVal, oldVal) => {

0 commit comments

Comments
 (0)