fix: date picker locale

This commit is contained in:
puriphatt 2024-06-14 11:01:06 +00:00
parent 5bc28bf893
commit c8b1a7551a
6 changed files with 70 additions and 28 deletions

View file

@ -87,13 +87,16 @@ function deleteFile(name: string) {
autoApply autoApply
v-model="startDate" v-model="startDate"
:teleport="true" :teleport="true"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-6" class="col-6"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
@ -131,13 +134,16 @@ function deleteFile(name: string) {
autoApply autoApply
v-model="retireDate" v-model="retireDate"
:teleport="true" :teleport="true"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-6" class="col-6"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input

View file

@ -139,13 +139,16 @@ defineProps<{
utc utc
autoApply autoApply
v-model="payDate" v-model="payDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-3" class="col-3"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input

View file

@ -249,13 +249,16 @@ onMounted(async () => {
autoApply autoApply
:teleport="true" :teleport="true"
v-model="checkup.coverageStartDate" v-model="checkup.coverageStartDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-3" class="col-3"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
@ -296,13 +299,16 @@ onMounted(async () => {
autoApply autoApply
:teleport="true" :teleport="true"
v-model="checkup.coverageExpireDate" v-model="checkup.coverageExpireDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-3" class="col-3"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input

View file

@ -124,13 +124,16 @@ defineProps<{
autoApply autoApply
:teleport="true" :teleport="true"
v-model="passportIssueDate" v-model="passportIssueDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-3" class="col-3"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
@ -165,13 +168,16 @@ defineProps<{
autoApply autoApply
:teleport="true" :teleport="true"
v-model="passportExpiryDate" v-model="passportExpiryDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-3" class="col-3"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input

View file

@ -97,13 +97,16 @@ onMounted(async () => {
autoApply autoApply
:teleport="true" :teleport="true"
v-model="visaIssueDate" v-model="visaIssueDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-3" class="col-3"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
@ -146,13 +149,16 @@ onMounted(async () => {
autoApply autoApply
:teleport="true" :teleport="true"
v-model="visaExpiryDate" v-model="visaExpiryDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-3" class="col-3"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
@ -210,13 +216,16 @@ onMounted(async () => {
autoApply autoApply
:teleport="true" :teleport="true"
v-model="visaStayUntilDate" v-model="visaStayUntilDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-6" class="col-6"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
@ -275,13 +284,16 @@ onMounted(async () => {
autoApply autoApply
:teleport="true" :teleport="true"
v-model="entryDate" v-model="entryDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-6" class="col-6"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input

View file

@ -194,13 +194,16 @@ onMounted(async () => {
autoApply autoApply
:teleport="true" :teleport="true"
v-model="work.workEndDate" v-model="work.workEndDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-6" class="col-6"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
@ -251,13 +254,16 @@ onMounted(async () => {
autoApply autoApply
:teleport="true" :teleport="true"
v-model="work.workPermitIssuDate" v-model="work.workPermitIssuDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-6" class="col-6"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
@ -299,13 +305,16 @@ onMounted(async () => {
autoApply autoApply
:teleport="true" :teleport="true"
v-model="work.workPermitExpireDate" v-model="work.workPermitExpireDate"
:locale="'th'" :locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:enableTimePicker="false" :enableTimePicker="false"
:disabled="readonly" :disabled="readonly"
class="col-6" class="col-6"
> >
<template #year="{ value }"> <template #year="{ value }">
{{ value + 543 }} {{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input