Long-term data custom date query - can't change end date to earlier than this month

Expected Behaviour:

Long-term data -> Query Log -> Select date and time range -> Custom Range

End date should be freely selectable to a date earlier than this month.

Actual Behaviour:

I need to search my Pi-Hole logs of about a year ago using the Custom Range in the long-term query log. While I can set the start date via the pop-up calendar without issue, I cannot set an end date earlier than the 1st of this month. Any earlier months are greyed out in the drop-down menu, and the year cannot be selected to anything less than 2021.

If I leave the end date to today and try to bring up a year's worth of log, PHP runs out of memory, despite setting its use to 3.9G in php.ini, so I need to be able to set an end date to sometime last year.

Is this a bug or intended behaviour?

This is not intended. I can freely chose any arbitrary date.

Please have a look in /var/log/lighttpd/error.log

Thanks. There is nothing added to that logfile when I navigate through Pi-Hole's admin pages nor when I open the calendar pop-up to select a date range.

I think it's a bit of a quirk. Or perhaps me... If I select a start month of, say, March 2020, the end month/year will update to April 2021. I go to change the end date year, but it cannot be selected to earlier than 2021. The entries in the month drop-down are greyed out Jan-Jun and cannot be selected. It is not until I clicked on an actual start date e.g. 1 March 2020, that the end date calendar section is updated (to Apr 2020 in this case).

Now that I know, fine, otherwise a gotcha if you don't know this.

Also, I cannot set a date range of more than 2 months. Is this intentional? I can't see a limitation documented anywhere.

If 2 months is the limit, I think it would help if the end date drop down menus were to be updated to reflect this when you select a start month/year, and vice versa. Is there a bug reporting/feature request website somewhere?

There is no such limit.

When 'painting' a calender range by picking a start date in the left hand calendar month, you can navigate to your desired month in the right hand calendar month and then click on an end date.
While this will make the right hand window jump back to the month following the start date, the actual end date you've picked is still active when clicking Apply.

I agree this is a bit confusing in terms of UI feedback, but you can apply an arbitrary date range as you require.

That was over a year ago.

Note that data for that month may not be available if you had reset your long-term database at some stage in the past or if you haven't configured your Pi-hole to retain data for longer than its standard one-year period to begin with (see MAXDBDAYS in Pi-hole's FTLDNS configuration).

Yes, I see what you are saying now. It is more than a bit confusing, I found it very confusing personally.

I think the range select ought to be simplified: on the LHS calendar navigate to the month you want and click the start date, the same on the RHS for the end date. That's it, no more. This is how date range selects generally work on websites e.g. banks. No automatic changing of months in the drop-down menu, no painting date range or any of that fanciness, just keep it simple.

I was not aware of the default 1 year retention, thanks for the tip.

What can be done with the datarange picker is change from this behaviour

Peek 2021-07-17 14-59

to this
Peek 2021-07-17 15-01

Yes, I think a "static" calendar for the start date LHS and the end date RHS (without any side's month auto-updating) is clearer. I personally don't see a need to "paint" a date range either, but that's just me, it doesn't bother me that much though.

I guess some logic to prevent selecting an invalid month/date combination (e.g. a LHS date later than RHS and vice versa) would be useful, but presumably the date range would be validated in any case.

Thanks for your effort in the gif anims too! :smiley:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.