xiaokuaisong-xiaochengxu/uniapp04/unpackage/dist/dev/mp-weixin/pages/goToPay/utils.js

23 lines
583 B
JavaScript
Raw Normal View History

2025-04-11 06:42:29 +00:00
"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;