Closed vofflan closed 3 weeks ago
Sounds like you encountered this , https://www.m365thinking.com/post/how-sharepoint-handles-datetime-stamps-and-why-it-causes-pnp-search-filter-urls-to-be-offset
@kasperbolarsen; I've read your post and I understand why it says thoose dates in my url. But when I choose date August 31, 2024, I thought I also will get documents created on August 31 but thats not the case?! Its until 2024-08-31 00:00 then I guess or what?
I think I understand the issue. If you enable "Show Selected Filters" it could be as this:
yet the query sent to the API reads: RefinableDate07:range(2021-08-31T22:00:00.000Z,2024-10-07T22:00:00.000Z,from="GE",to="LE") Which does NOT include the start and end dates, yet the "Show selected filters" seems to indicate that those ARE included. Am I on the right track?
For me it looks like this in url: [{"filterName":"RefinableDate00","values":[{"name":"2024-08-06T22:00:00.000Z","value":"2024-08-06T22:00:00.000Z","operator":4},{"name":"2024-08-30T22:00:00.000Z","value":"2024-08-30T22:00:00.000Z","operator":5}],"operator":"and"}] and show selected filter says: [Fastställd datum>="August 7, 2024" AND Fastställd datum<="August 31, 2024"]
So, I expected to get documents between August 7, 2024 and August 31, 2024. But the documents that are created on August 31, 2024 wont show upp within this search. I have to set "To"-date to Sept 1, 2024 and then documents created on August 31, 2024 will appear.
Oct 1-4 turns into this FQL: Write:range(2024-09-30T22:00:00.000Z,2024-10-03T22:00:00.000Z,from="GE",to="LE")
, as the implementation is starting from and up until end date. I'm in Oslo, which means that is GMT+2, and the time portions are reduced with 2h to match my time zone as querying dates are in zero time.
If the end date should be including all values including that date is a semantic discussion.
OOB search would turn the same filter into: Write:(range(2024-09-30T22:00:00.000Z, 2024-10-04T21:59:59.999Z))"}
where the default from is GE and default to is LT. If we are to align with OOB we add one more day to the to value as aligning with OOB search is always a good thing :)
Version used 4.13.1.0
Describe the bug When adding a date interval to search filter I want to filter dates between for example From: August 8, 2024 and To: August 31 2024. When I do that the filter url looks like this: SitePages/Arkivsok.aspx?f=%5B%7B"filterName"%3A"RefinableDate00"%2C"values"%3A%5B%7B"name"%3A"2024-08-07T22%3A00%3A00.000Z"%2C"value"%3A"**2024-08-07T22%3A00%3A00.000Z"%2C"operator"%3A4%7D%2C%7B"name"%3A"2024-08-30T22%3A00%3A00.000Z"%2C"value"%3A"2024-08-30T22%3A00%3A00.000Z**"%2C"operator"%3A5%7D%5D%2C"operator"%3A"and"%7D%5D#
For some reason the wrong dates are picked.
To Reproduce Detailed steps to reproduce the behavior:
Expected behavior If I pick date From: August 8, 2024 and date To: August 31, 2024 I want documents listed for thoose dates.
Screenshots
Desktop (please complete the following information):