Skip to content

Commit 2a303ef

Browse files
committed
Use negative days value for days before
1 parent 9869e81 commit 2a303ef

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
netlify-token: ${{ secrets.NETLIFY_TOKEN }}
2929
netlify-site-id: ${{ secrets.NETLIFY_SITE }}
30-
days: 0
30+
days: -1
3131
disable-header: true
3232
- uses: niklasmerz/csv-to-google-spreadsheet@master
3333
with:

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ endDate.setUTCMinutes(59);
1818
endDate.setUTCSeconds(59);
1919
endDate.setUTCMilliseconds(999);
2020

21+
if (days < 0) {
22+
startDate.setDate(startDate.getDate() - (days * -1));
23+
endDate.setDate(endDate.getDate() - (days * -1));
24+
}
25+
2126
if (days > 0) {
2227
startDate.setDate(endDate.getDate() - days);
2328
}
2429

25-
2630
let timezone = startDate.getTimezoneOffset() / 60 * -100;
2731
if (timezone >= 1000) {
2832
timezone = "+" + timezone;

0 commit comments

Comments
 (0)