MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getPreviousWeekRange

Function getPreviousWeekRange

scripts/sendWeeklyExcelSheet.mjs:10–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8const SLACK_CHANNEL_ID = process.env.SLACK_CHANNEL_ID;
9
10function getPreviousWeekRange() {
11 let today = new Date();
12 let endDate = new Date(today);
13
14 let startDate = new Date(today);
15 startDate.setDate(today.getDate() - 7);
16
17 function fmt(d) {
18 return d.toISOString().split('T')[0];
19 }
20
21 return {startDate: fmt(startDate), endDate: fmt(endDate)};
22}
23
24function formatDateLabel(dateStr) {
25 let d = new Date(dateStr + 'T12:00:00Z');

Callers 1

mainFunction · 0.85

Calls 2

fmtFunction · 0.85
setDateMethod · 0.80

Tested by

no test coverage detected