上传代码
This commit is contained in:
22
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToPay/utils.js
vendored
Normal file
22
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToPay/utils.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
function getDate(date, AddDayCount = 0) {
|
||||
if (!date) {
|
||||
date = /* @__PURE__ */ new Date();
|
||||
}
|
||||
if (typeof date !== "object") {
|
||||
date = date.replace(/-/g, "/");
|
||||
}
|
||||
const dd = new Date(date);
|
||||
dd.setDate(dd.getDate() + AddDayCount);
|
||||
const y = dd.getFullYear();
|
||||
const m = dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1;
|
||||
const d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();
|
||||
return {
|
||||
fullDate: y + "-" + m + "-" + d,
|
||||
year: y,
|
||||
month: m,
|
||||
date: d,
|
||||
day: dd.getDay()
|
||||
};
|
||||
}
|
||||
exports.getDate = getDate;
|
Reference in New Issue
Block a user