Complete core mini program flows
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
function localDate(date = new Date()) {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
||||
function shiftDate(value, days) {
|
||||
const date = new Date(`${value}T12:00:00`);
|
||||
date.setDate(date.getDate() + days);
|
||||
return localDate(date);
|
||||
}
|
||||
|
||||
module.exports = { localDate, shiftDate };
|
||||
Reference in New Issue
Block a user