MCPcopy Index your code
hub / github.com/adobe/react-spectrum / getPreviousWeekRange

Function getPreviousWeekRange

scripts/sendWeeklyExcelSheet.mjs:13–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11}
12
13function getPreviousWeekRange() {
14 let today = new Date();
15 let endDate = new Date(today);
16
17 let startDate = new Date(today);
18 startDate.setDate(today.getDate() - 7);
19
20 function fmt(d) {
21 return d.toISOString().split('T')[0];
22 }
23
24 return {startDate: fmt(startDate), endDate: fmt(endDate)};
25}
26
27function formatDateLabel(dateStr) {
28 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