`<value> | date` filter to return a Date object from `Date.parse(<value>)`
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
This issue arises from jekyll/jekyll#6581
The intent is to be able to craft arbitrary dates and to enact date comparisons, like post.date in Jekyll for example.
For example, crafting a date and fetching a post published on that day:
{% assign day = '01' | prefix: '2017-12-' | date %}
{% assign post = site.posts | where_exp: 'post', 'post.date == day' | first %}
At the moment, the only known ways to create a plain Date object is with 'now' | date and 'today' | date.
Current code is:
What do you think?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the date-filter implementation in lib/liquid/standardfilters.rb at the linked lines, then compare its current handling of 'now' and 'today' with the proposed crafted-date example. Done should provide a clear way for a parsed date value to become a Date object and compare with post.date, while preserving existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100