Skip to content

Commit 77b3833

Browse files
PromoFauxyubiuser
andcommitted
Use the start of day for past 7 and 30 days
No need to check for null on endofTime, it will always have a values Co-authored-by: yubiuser <[email protected]> Signed-off-by: Adam Warner <[email protected]>
1 parent 1b50959 commit 77b3833

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/js/queries.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function getDatabaseInfo() {
7777

7878
function initDateRangePicker() {
7979
// If there's no valid data in the database, disable the datepicker
80-
if (beginningOfTime === null || endOfTime === null) {
80+
if (beginningOfTime === null) {
8181
$("#querytime").prop("disabled", true);
8282
$("#querytime").addClass("disabled");
8383
$("#querytime-note").text("ℹ️ No data in the database");
@@ -105,8 +105,8 @@ function initDateRangePicker() {
105105
moment().subtract(1, "days").startOf("day"),
106106
moment().subtract(1, "days").endOf("day"),
107107
],
108-
"Last 7 Days": [moment().subtract(6, "days"), maxDateMoment],
109-
"Last 30 Days": [moment().subtract(29, "days"), maxDateMoment],
108+
"Last 7 Days": [moment().subtract(6, "days").startOf("day"), maxDateMoment],
109+
"Last 30 Days": [moment().subtract(29, "days").startOf("day"), maxDateMoment],
110110
"This Month": [moment().startOf("month"), maxDateMoment],
111111
"Last Month": [
112112
moment().subtract(1, "month").startOf("month"),

0 commit comments

Comments
 (0)