From 142ba3ed00220dcadf2a94e59664d5f1f027dbf4 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期三, 05 六月 2024 14:58:26 +0800 Subject: [PATCH] 新增附件上传 --- src/util/date.js | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/util/date.js b/src/util/date.js index 867a406..03629d0 100644 --- a/src/util/date.js +++ b/src/util/date.js @@ -1,8 +1,7 @@ /** * 鑾峰彇骞存湀鏃� */ -export function getYearAndMonthAndDays() { - const date = new Date() +export function getYearAndMonthAndDays(date=new Date()) { let year = date.getFullYear() let month = date.getMonth() + 1 if (month < 10) { @@ -12,5 +11,10 @@ } year = year + '-' let days = date.getDate() - return year + month + days + if (days < 10) { + days = '0' + days + } else { + days = days + } + return (year + month + days) } -- Gitblit v1.9.3