WIP Изменила отправку документов

This commit is contained in:
Daria Golova
2023-08-23 19:16:19 +03:00
parent 4987a3ae09
commit cb41a00ae1
6 changed files with 162 additions and 143 deletions

View File

@@ -75,21 +75,20 @@ export default {
return {
calendarVisibility: false,
internalDate: null,
//internalValue: null,
};
},
computed: {
value: {
get() {
this.changeInternalDate(
moment(this.convertFormat(this.modelValue)).isValid()
? moment(this.convertFormat(this.modelValue))
moment(this.checkFormat(this.modelValue)).isValid()
? moment(this.modelValue)
: null
);
return this.modelValue;
return this.convertISOFormat(this.modelValue);
},
set(value) {
this.$emit("update:modelValue", value);
this.$emit("update:modelValue", this.convertRUFormat(value));
},
},
sizeVariable() {
@@ -138,13 +137,17 @@ export default {
},
},
methods: {
convertFormat(date) {
return date && date?.length === 10
? date.split(".").reverse().join("-")
: null;
convertISOFormat(date) {
return date?.split("-")?.reverse()?.join(".");
},
convertRUFormat(date) {
return date?.split(".")?.reverse()?.join("-");
},
checkFormat(date) {
return date && date?.length === 10 ? date : null;
},
defaultRule(val) {
return !val || moment(this.convertFormat(val)).isValid();
return !val || moment(this.convertRUFormat(val)).isValid();
},
closeCalendar() {
this.calendarVisibility = false;