fix: change calculate age function store

This commit is contained in:
puriphatt 2024-07-16 03:24:13 +00:00
parent 204a854a1c
commit 1c5acba093
4 changed files with 6 additions and 46 deletions

View file

@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, onMounted, watch, computed } from 'vue';
import useUtilsStore, { dialog, calculateAge } from 'src/stores/utils';
import useUtilsStore, { dialog } from 'src/stores/utils';
import { calculateAge } from 'src/utils/datetime';
import type { QTableProps } from 'quasar';
import { storeToRefs } from 'pinia';
import { useI18n } from 'vue-i18n';

View file

@ -59,7 +59,8 @@ import FormEmployeeWorkHistory from 'src/components/03_customer-management/FormE
import FormEmployeeOther from 'src/components/03_customer-management/FormEmployeeOther.vue';
import FormEmployeePassport from 'src/components/03_customer-management/FormEmployeePassport.vue';
import FormEmployeeVisa from 'src/components/03_customer-management/FormEmployeeVisa.vue';
import useUtilsStore, { dialog, calculateAge } from 'src/stores/utils';
import useUtilsStore, { dialog } from 'src/stores/utils';
import { calculateAge } from 'src/utils/datetime';
import { useI18n } from 'vue-i18n';
import useFlowStore from 'src/stores/flow';
@ -2416,7 +2417,7 @@ watch([inputSearch, currentStatus], async () => {
<q-td
v-if="fieldSelected.includes('formDialogInputAge')"
>
{{ userStore.calculateAge(props.row.dateOfBirth) }}
{{ calculateAge(props.row.dateOfBirth) }}
</q-td>
<q-td
@ -2597,9 +2598,7 @@ watch([inputSearch, currentStatus], async () => {
{
icon: 'mdi-clock-outline',
value: props.row.dateOfBirth
? userStore.calculateAge(
props.row.dateOfBirth,
) ?? ''
? calculateAge(props.row.dateOfBirth) ?? ''
: '',
},
],