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();
|
return new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWeekStart() {
|
function getLast30Days() {
|
||||||
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() {
|
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
var monthAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
var monthAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
||||||
return { now: now.getTime(), monthAgo: monthAgo.getTime() };
|
return { now: now.getTime(), monthAgo: monthAgo.getTime() };
|
||||||
|
|
@ -158,13 +149,20 @@ const TOKEN = import.meta.env.PUBLIC_ACCESS_TOKEN || '';
|
||||||
return monthStart.toISOString();
|
return monthStart.toISOString();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSinceDate() {
|
function getWeekStart() {
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
var day = now.getDay();
|
var day = now.getDay();
|
||||||
var diff = now.getDate() - day + (day === 0 ? -6 : 1);
|
var diff = now.getDate() - day + (day === 0 ? -6 : 1);
|
||||||
var monday = new Date(now.setDate(diff));
|
var monday = new Date(now.setDate(diff));
|
||||||
monday.setHours(0, 0, 0, 0);
|
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) {
|
function getDayKey(dateStr) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue