hello, This problem was dormant for a while and I’ve completely ignored about the day31 issue
now that I’ve got better accustomed to the debugger, here is the out put of the phenomenon
Where is this non-date coming from? If it’s in a page’s frontmatter, then just change the page. If the filesystem itself is returning this date, then you have a much larger problem. That shouldn’t be possible. You’ll need to find forums for your OS. I don’t see how this is a Grav issue. It’s doing exactly what it’s supposed to do: blow up when given an invalid date.
hi Perlkonig, thanx for your reply.
The page collection is gathering post from the creation date of a file, so I’m speculating that daterange function being the culprit.
{% for post in page.collection.dateRange(d,d+1).order('date', 'desc') %}
1. get unique date from various posts by:
{% set uDate=[] %}
{% for i in page.collection %}
{# {% set uDate = uDate|merge([i.date|date('Ymd')]) %} #}
2. changed the format so it would be recognized as a date.
{% set uDate = uDate|merge([i.date|date('Y-m-d')]) %}
{% endfor %}
{%- set uDate = uDate|array_unique -%}
3. set the range terminator variable by date_modify no more day 32!!
{% set e = d|date_modify("+1 day")|date("Y-m-d") %}
finally use
{% for post in page.collection.dateRange(d,e).order('date', 'desc') %}