fix birthday

parent e79d685f
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
:rules="sexRules" :rules="sexRules"
hide-bottom-space hide-bottom-space
></q-select> ></q-select>
<q-input <!-- <q-input
:model-value="birthday" :model-value="birthday"
@update:model-value="$emit('update:birthday', $event)" @update:model-value="$emit('update:birthday', $event)"
:rules="birthdayRules" :rules="birthdayRules"
...@@ -126,7 +126,41 @@ ...@@ -126,7 +126,41 @@
{{ $t('userPage.dialogLabel.fieldLabels.birthday') }} * {{ $t('userPage.dialogLabel.fieldLabels.birthday') }} *
</div> </div>
</template> </template>
</q-input> -->
<q-input
:model-value="birthday"
@update:model-value="$emit('update:birthday', $event)"
:label="$t('userPage.dialogLabel.fieldLabels.birthday')"
outlined
:rules="birthdayRules"
hide-bottom-space
>
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy
ref="qDateProxy"
transition-show="scale"
transition-hide="scale"
>
<q-date
:model-value="birthday"
@update:model-value="$emit('update:birthday', $event)"
mask="DD/MM/YYYY"
>
<div class="row items-center justify-end">
<q-btn
v-close-popup
label="Close"
color="primary"
flat
/>
</div>
</q-date>
</q-popup-proxy>
</q-icon>
</template>
</q-input> </q-input>
<q-select <q-select
:model-value="group" :model-value="group"
@update:model-value="$emit('update:group', $event)" @update:model-value="$emit('update:group', $event)"
......
...@@ -93,21 +93,40 @@ ...@@ -93,21 +93,40 @@
:rules="sexRules" :rules="sexRules"
hide-bottom-space hide-bottom-space
></q-select> ></q-select>
<q-input <q-input
:model-value="birthday" :model-value="birthday"
@update:model-value="$emit('update:birthday', $event)" @update:model-value="$emit('update:birthday', $event)"
type="date" :label="$t('userPage.dialogLabel.fieldLabels.birthday')"
outlined outlined
:rules="birthdayRules" :rules="birthdayRules"
hide-bottom-space hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:append>
<div class="text-body2"> <q-icon name="event" class="cursor-pointer">
{{ $t('userPage.dialogLabel.fieldLabels.birthday') }} * <q-popup-proxy
</div> ref="qDateProxy"
transition-show="scale"
transition-hide="scale"
>
<q-date
:model-value="birthday"
@update:model-value="$emit('update:birthday', $event)"
mask="DD/MM/YYYY"
>
<div class="row items-center justify-end">
<q-btn
v-close-popup
label="Close"
color="primary"
flat
/>
</div>
</q-date>
</q-popup-proxy>
</q-icon>
</template> </template>
</q-input> </q-input>
<q-select <q-select
:model-value="group" :model-value="group"
@update:model-value="$emit('update:group', $event)" @update:model-value="$emit('update:group', $event)"
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
phoneNumber: 'Số máy bàn', phoneNumber: 'Số máy bàn',
unit: 'Đơn vị phòng ban *', unit: 'Đơn vị phòng ban *',
sex: 'Giới tính *', sex: 'Giới tính *',
birthday: 'Ngày sinh', birthday: 'Ngày sinh *',
group: 'Thuộc nhóm *', group: 'Thuộc nhóm *',
scheduleAccess: 'Lịch truy cập', scheduleAccess: 'Lịch truy cập',
status: 'Trạng thái', status: 'Trạng thái',
......
...@@ -18,6 +18,7 @@ export default defineComponent({ ...@@ -18,6 +18,7 @@ export default defineComponent({
UpdateCategoryPostDialog, UpdateCategoryPostDialog,
}, },
setup() { setup() {
const date = ref('');
const configImg = config; const configImg = config;
const keywordSearch: Ref<string | null> = ref(null); const keywordSearch: Ref<string | null> = ref(null);
const userTableColumnsCategoryPost = [ const userTableColumnsCategoryPost = [
...@@ -234,6 +235,7 @@ export default defineComponent({ ...@@ -234,6 +235,7 @@ export default defineComponent({
void getLanguages(); void getLanguages();
}); });
return { return {
date,
configImg, configImg,
keywordSearch, keywordSearch,
userTableColumnsCategoryPost, userTableColumnsCategoryPost,
......
...@@ -182,7 +182,8 @@ export default defineComponent({ ...@@ -182,7 +182,8 @@ export default defineComponent({
userName: userName.value.trim(), userName: userName.value.trim(),
password: password.value, password: password.value,
fullName: fullName.value.trim(), fullName: fullName.value.trim(),
birthday: birthday.value, // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
birthday: birthday.value + ' 00:00:00',
email: email.value.trim(), email: email.value.trim(),
phoneNumber: phoneNumber.value.trim(), phoneNumber: phoneNumber.value.trim(),
mobileNumber: mobileNumber.value.trim(), mobileNumber: mobileNumber.value.trim(),
...@@ -313,7 +314,7 @@ export default defineComponent({ ...@@ -313,7 +314,7 @@ export default defineComponent({
birthday.value = moment( birthday.value = moment(
userInfo.birthday, userInfo.birthday,
'DD/MM/YYYY HH:mm:ss' 'DD/MM/YYYY HH:mm:ss'
).format('YYYY-MM-DD'); ).format('DD/MM/YYYY');
email.value = userInfo.email as string; email.value = userInfo.email as string;
fullName.value = userInfo.fullName as string; fullName.value = userInfo.fullName as string;
mobileNumber.value = userInfo.mobileNumber as string; mobileNumber.value = userInfo.mobileNumber as string;
...@@ -338,7 +339,8 @@ export default defineComponent({ ...@@ -338,7 +339,8 @@ export default defineComponent({
userName: userName.value.trim(), userName: userName.value.trim(),
password: password.value, password: password.value,
fullName: fullName.value.trim(), fullName: fullName.value.trim(),
birthday: birthday.value, // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
birthday: birthday.value + ' 00:00:00',
email: email.value.trim(), email: email.value.trim(),
phoneNumber: phoneNumber.value.trim(), phoneNumber: phoneNumber.value.trim(),
mobileNumber: mobileNumber.value.trim(), mobileNumber: mobileNumber.value.trim(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment