MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / todayInfo

Function todayInfo

wxapp/tmj.js:68–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68function todayInfo() {
69 const d = new Date();
70 const y = d.getFullYear();
71 const m = d.getMonth() + 1;
72 const day = d.getDate();
73 const pad = (n) => String(n).padStart(2, "0");
74 return {
75 year: y,
76 month: m,
77 day,
78 today: `${y}-${pad(m)}-${pad(day)}`,
79 startDate: `${y}-${m}-01`,
80 endDate: `${y}-${m}-${new Date(y, m, 0).getDate()}`,
81 };
82}
83
84function normalizeDate(value) {
85 const text = String(value || "").slice(0, 10);

Callers 2

queryMonthSignMethod · 0.85
doSignMethod · 0.85

Calls 1

padFunction · 0.70

Tested by

no test coverage detected