Let me know if you’d like any more info.
So far, you’ve not given us enough factual and reproducible data for us to try to replicate the issue.
- Eg. “31 December” doesn’t tell us anything about the actual value of the
datefield in the frontmatter of the page. Please show us the frontmatter of the page. - You’re not sharing if you’re using Admin to edit the
datefield, or using a text editor to edit the page file. What Admin shows and what Admin writes might not be the same. - You haven’t shown that you tried to exactly replicate the script shown by @Karmalakas and the debug results you’re getting.
Here is a more simple script that works fine in Grav v1.7.48 and Grav v1.8.0-beta.4. To rule out the effects of Admin, use a text editor only.
- Install a fresh copy of Grav from a downloaded zip file.
- Add the
dump()command to template /user/themes/quark/templates/default.html.twig{% block content %} {{ dump(page.collection.dateRange('01/01/2024', '12/31/2024')) }} {{ page.content|raw }} {% endblock %} - Using a text editor, edit file /user/pages/01.home/default.md and add a collection:
content: items: '@self.siblings' - When using Grav 1.7.48, run
$ touch user/pages/02.typography/default.md. You could also make a change in the Markdown of the page.
This will set the last modified date to today, excluding it from abovedateRange - Run the browser on the Home page and examine Clockwork.
Clockwork should show an emptyitemsarray
This to be expected because the fallbackdateis the last modified date of the file.* Array(1) object: Grav\Common\Page\Collection * object: Grav\Common\Page\Collection * *items: Array(0) * ~iteratorUnset: true * *pages: Grav\Common\Page\Pages * *params: Array(2) - Using a text editor, edit file /user/pages/02.typography/default.md and set the
datefield:date: 12/31/2024 - Run the browser on the home page and examine Clockwork.
Clockwork should show anitemarray containing page ‘typography’:* Array(1) object: Grav\Common\Page\Collection * object: Grav\Common\Page\Collection * *items: Array(1) * /www/grav/xx/grav17/user/pages/02.typography: Array(1) * ~iteratorUnset: true * *pages: Grav\Common\Page\Pages * *params: Array(2)
If the outcome of above script is not as expected, please provide a detailed script, including frontmatter and Clockwork data, so we can replicate it and reproduce the issue.