Compare commits
1 Commits
50fba1a909
...
fca79c36ef
Author | SHA1 | Date |
---|---|---|
Ferdinand Thiessen | fca79c36ef |
|
@ -62,8 +62,8 @@ export default defineComponent({
|
||||||
setup(props, { emit, attrs }) {
|
setup(props, { emit, attrs }) {
|
||||||
const customRules = computed(() => [
|
const customRules = computed(() => [
|
||||||
props.type == 'date' ? stringIsDate : props.type == 'time' ? stringIsTime : stringIsDateTime,
|
props.type == 'date' ? stringIsDate : props.type == 'time' ? stringIsTime : stringIsDateTime,
|
||||||
(value?: string | null) => {
|
(value?: string) => {
|
||||||
if (props.rules.length > 0 && value) {
|
if (props.rules.length > 0 && !!value) {
|
||||||
let date: Date | undefined = undefined;
|
let date: Date | undefined = undefined;
|
||||||
if (props.type == 'date') date = modifyDate(value);
|
if (props.type == 'date') date = modifyDate(value);
|
||||||
else if (props.type == 'time') date = modifyTime(value);
|
else if (props.type == 'time') date = modifyTime(value);
|
||||||
|
@ -71,10 +71,11 @@ export default defineComponent({
|
||||||
const split = value.split(' ');
|
const split = value.split(' ');
|
||||||
date = modifyTime(split[1], modifyDate(split[0]));
|
date = modifyTime(split[1], modifyDate(split[0]));
|
||||||
}
|
}
|
||||||
props.rules.forEach((rule) => {
|
for (const rule of props.rules) {
|
||||||
const r = rule(date);
|
const r = rule(date);
|
||||||
if (typeof r === 'string') return r;
|
if (typeof r === 'string') return r;
|
||||||
});
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in New Issue