Skip to content

Commit 4896c7d

Browse files
committed
Fix same day date range
1 parent 12afbf0 commit 4896c7d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

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

21-
startDate.setDate(endDate.getDate() - days);
21+
if (days > 0) {
22+
startDate.setDate(endDate.getDate() - days);
23+
}
2224

2325

2426
let timezone = startDate.getTimezoneOffset() / 60 * -100;

0 commit comments

Comments
 (0)