From 77658c765cf7efda6ab68bb92323eea6d87e19ff Mon Sep 17 00:00:00 2001 From: gaoluyang <gaoluyang@rengu.cc> Date: 星期日, 04 八月 2024 17:01:33 +0800 Subject: [PATCH] 1.下单里面所有特殊项目的弹框都加一个确认按钮再关闭页面,不然很容易还没选好页面就关闭了不容易再次更改 --- 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