1234567891011121314151617181920212223242526272829303132 |
- "use strict";
- function formateDate(datetime, type) {
- const year = datetime.getFullYear();
- const month = String(datetime.getMonth() + 1).padStart(2, "0");
- const date = String(datetime.getDate()).padStart(2, "0");
- const hour = String(datetime.getHours()).padStart(2, "0");
- const minute = String(datetime.getMinutes()).padStart(2, "0");
- const second = String(datetime.getSeconds()).padStart(2, "0");
- switch (type) {
- case "Y-M-D h:min:s":
- return `${year}-${month}-${date} ${hour}:${minute}:${second}`;
- case "Y-M-D":
- return `${year}年${month}月${date}日`;
- case "h:min:s":
- return `${hour}:${minute}:${second}`;
- case "h":
- return hour;
- case "min":
- return minute;
- default:
- return "";
- }
- }
- function isSameDay(timeStampA) {
- const dateA = new Date(timeStampA);
- const dateB = /* @__PURE__ */ new Date();
- return dateA.setHours(0, 0, 0, 0) === dateB.setHours(0, 0, 0, 0);
- }
- exports.formateDate = formateDate;
- exports.isSameDay = isSameDay;
- //# sourceMappingURL=../../.sourcemap/mp-weixin/common/util.js.map
|