Fix false since parameter being set in request
This commit is contained in:
parent
c04e80dbd9
commit
2354fc8361
1 changed files with 10 additions and 12 deletions
|
|
@ -136,16 +136,7 @@ const TOKEN = import.meta.env.PUBLIC_ACCESS_TOKEN || '';
|
|||
return new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
|
||||
}
|
||||
|
||||
function getWeekStart() {
|
||||
var now = new Date();
|
||||
var day = now.getDay();
|
||||
var diff = now.getDate() - day + (day === 0 ? -6 : 1);
|
||||
var monday = new Date(now.setDate(diff));
|
||||
monday.setHours(0, 0, 0, 0);
|
||||
return monday.getTime();
|
||||
}
|
||||
|
||||
function getLast30Days() {
|
||||
function getLast30Days() {
|
||||
var now = new Date();
|
||||
var monthAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
||||
return { now: now.getTime(), monthAgo: monthAgo.getTime() };
|
||||
|
|
@ -158,13 +149,20 @@ const TOKEN = import.meta.env.PUBLIC_ACCESS_TOKEN || '';
|
|||
return monthStart.toISOString();
|
||||
}
|
||||
|
||||
function getSinceDate() {
|
||||
function getWeekStart() {
|
||||
var now = new Date();
|
||||
var day = now.getDay();
|
||||
var diff = now.getDate() - day + (day === 0 ? -6 : 1);
|
||||
var monday = new Date(now.setDate(diff));
|
||||
monday.setHours(0, 0, 0, 0);
|
||||
return monday.toISOString();
|
||||
return monday.getTime();
|
||||
}
|
||||
|
||||
function getSinceDate() {
|
||||
var now = new Date();
|
||||
var since = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||
since.setHours(0, 0, 0, 0);
|
||||
return since.toISOString();
|
||||
}
|
||||
|
||||
function getDayKey(dateStr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue