fixed date

parent 8a408ba7
import { defineComponent, PropType } from 'vue';
import { defineComponent, PropType, ref, Ref } from 'vue';
import { i18n } from 'src/boot/i18n';
import { isEmail } from '../../../boot/functions';
import { isMobilePhone } from '../../../boot/functions';
import { GroupInfoType } from 'src/pages/nhom-nguoi-dung/UserGroup';
import moment from 'moment';
export default defineComponent({
props: {
showDialog: {
......@@ -28,6 +28,8 @@ export default defineComponent({
status: { type: Boolean, required: true },
},
setup() {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const today = ref(moment().format('YYYY/MM/DD'));
const userNameRules = [
(val?: string) =>
(val && val.trim().length) ||
......@@ -83,6 +85,7 @@ export default defineComponent({
val?.length || i18n.global.t('userPage.validateMessages.requiredGroup'),
];
return {
today,
userNameRules,
passwordRules,
fullNameRules,
......
......@@ -146,6 +146,10 @@
:model-value="birthday"
@update:model-value="$emit('update:birthday', $event)"
mask="DD/MM/YYYY"
:options="
(birthday) =>
birthday >= '1900/01/01' && birthday <= today
"
>
<div class="row items-center justify-end">
<q-btn
......
import { defineComponent, PropType } from 'vue';
import { defineComponent, PropType, ref } from 'vue';
import { i18n } from 'src/boot/i18n';
import { isEmail } from '../../../boot/functions';
import { isMobilePhone } from '../../../boot/functions';
import { GroupInfoType } from 'src/pages/nhom-nguoi-dung/UserGroup';
import moment from 'moment';
export default defineComponent({
props: {
showDialogUpdate: {
......@@ -26,6 +26,8 @@ export default defineComponent({
status: { type: Boolean, required: true },
},
setup() {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const today = ref(moment().format('YYYY/MM/DD'));
const fullNameRules = [
(val?: string) =>
(val && val.trim().length) ||
......@@ -66,6 +68,7 @@ export default defineComponent({
val?.length || i18n.global.t('userPage.validateMessages.requiredGroup'),
];
return {
today,
fullNameRules,
emailRules,
mobileNumberRules,
......
......@@ -111,6 +111,10 @@
<q-date
:model-value="birthday"
@update:model-value="$emit('update:birthday', $event)"
:options="
(birthday) =>
birthday >= '1900/01/01' && birthday <= today
"
mask="DD/MM/YYYY"
>
<div class="row items-center justify-end">
......
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