mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 02:38:28 +00:00
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 <github@yubiuser.dev> Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
@@ -77,7 +77,7 @@ function getDatabaseInfo() {
|
|||||||
|
|
||||||
function initDateRangePicker() {
|
function initDateRangePicker() {
|
||||||
// If there's no valid data in the database, disable the datepicker
|
// If there's no valid data in the database, disable the datepicker
|
||||||
if (beginningOfTime === null || endOfTime === null) {
|
if (beginningOfTime === null) {
|
||||||
$("#querytime").prop("disabled", true);
|
$("#querytime").prop("disabled", true);
|
||||||
$("#querytime").addClass("disabled");
|
$("#querytime").addClass("disabled");
|
||||||
$("#querytime-note").text("ℹ️ No data in the database");
|
$("#querytime-note").text("ℹ️ No data in the database");
|
||||||
@@ -105,8 +105,8 @@ function initDateRangePicker() {
|
|||||||
moment().subtract(1, "days").startOf("day"),
|
moment().subtract(1, "days").startOf("day"),
|
||||||
moment().subtract(1, "days").endOf("day"),
|
moment().subtract(1, "days").endOf("day"),
|
||||||
],
|
],
|
||||||
"Last 7 Days": [moment().subtract(6, "days"), maxDateMoment],
|
"Last 7 Days": [moment().subtract(6, "days").startOf("day"), maxDateMoment],
|
||||||
"Last 30 Days": [moment().subtract(29, "days"), maxDateMoment],
|
"Last 30 Days": [moment().subtract(29, "days").startOf("day"), maxDateMoment],
|
||||||
"This Month": [moment().startOf("month"), maxDateMoment],
|
"This Month": [moment().startOf("month"), maxDateMoment],
|
||||||
"Last Month": [
|
"Last Month": [
|
||||||
moment().subtract(1, "month").startOf("month"),
|
moment().subtract(1, "month").startOf("month"),
|
||||||
|
|||||||
Reference in New Issue
Block a user