【修改】增加图标 修改删除10个的关键字 修改日期显示格式

This commit is contained in:
zhoulingpo
2023-05-15 16:06:36 +08:00
parent a3b7711582
commit d13c4f6e70
7 changed files with 125 additions and 85 deletions
+9 -1
View File
@@ -4,6 +4,7 @@
* @param fmt
* @returns {*}
*/
export function formatDate (value, fmt) {
const regPos = /^\d+(\.\d+)?$/
if (regPos.test(value)) {
@@ -41,6 +42,13 @@ export function formatDate2 (value, fmt) {
let hours = dateObject.getHours();
let minutes = dateObject.getMinutes();
let seconds = dateObject.getSeconds();
function timeAdd0(str) {
if(str<=9){
str='0'+str;
}
return str
}
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
console.log(seconds)
return `${year}-${month}-${day} ${timeAdd0(hours)}:${timeAdd0(minutes)}:${timeAdd0(seconds)}`;
}