function convertdate
This commit is contained in:
parent
1d6e86c918
commit
07c782950a
1 changed files with 17 additions and 0 deletions
|
|
@ -304,6 +304,22 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
}
|
||||
}
|
||||
|
||||
function convertDate(date: string) {
|
||||
if (date != null && date.length == 10) {
|
||||
const srcDate = date.split("/");
|
||||
const dateVal =
|
||||
Number(srcDate[2]) - 543 + "-" + srcDate[1] + "-" + srcDate[0];
|
||||
|
||||
if (moment(dateVal).isValid()) {
|
||||
return dateVal;
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
function appendLeadingZeroes(n: number) {
|
||||
if (n <= 9) return "0" + n;
|
||||
return n;
|
||||
|
|
@ -956,5 +972,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
dialogRemove,
|
||||
dialogMessageNotify,
|
||||
fails,
|
||||
convertDate,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue