feat: replace all hardcoded en-US and $ formatting with locale-aware helpers
This commit is contained in:
@@ -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 ───────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user