feat: replace all hardcoded en-US and $ formatting with locale-aware helpers

This commit is contained in:
Your Name
2026-02-17 23:39:31 +02:00
parent fe0b20f247
commit 519bdabe61
7 changed files with 23 additions and 53 deletions

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, computed, watch, onBeforeUnmount, nextTick } from 'vue'
import { Calendar, ChevronLeft, ChevronRight } from 'lucide-vue-next'
import { getLocaleCode } from '../utils/locale'
interface Props {
modelValue: string
@@ -29,7 +30,7 @@ const displayText = computed(() => {
if (!props.modelValue) return null
const [y, m, d] = props.modelValue.split('-').map(Number)
const date = new Date(y, m - 1, d)
return date.toLocaleDateString('en-US', {
return date.toLocaleDateString(getLocaleCode(), {
month: 'short',
day: 'numeric',
year: 'numeric',
@@ -38,7 +39,7 @@ const displayText = computed(() => {
const viewMonthLabel = computed(() => {
const date = new Date(viewYear.value, viewMonth.value, 1)
return date.toLocaleDateString('en-US', { month: 'long', year: 'numeric' })
return date.toLocaleDateString(getLocaleCode(), { month: 'long', year: 'numeric' })
})
// ── Today helpers ───────────────────────────────────────────────────