I am trying to filter in a collection of events the ones that have a date in the future ( > site.time ).
This works perfectly when it is the date of the post, but can’t make it work with an additional date from the YAML frontmatter.
In this case, I have an additional ‘end-date’ in some of the events, but that does not seem treated correctly in the where_exp filter:
{% assign filtered_events = site.events | where_exp: 'event', 'event.date >= site.time or event.end-date !="" and event.end-date >= site.time' %}
results in this error:
/home/bibliotecaris/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/liquid-4.0.3/lib/liquid/condition.rb:127:in `rescue in interpret_condition': Liquid error (line 37): comparison of Date with Time failed (Liquid::ArgumentError)
In the front-matter it is some times:
date: 2022-03-15
end-date: 2022-05-31
and some other:
date: 2022-03-15
end-date: ""
Any ideas?
Thanks a lot in advance!
Mario