Shopify / Shopify/liquid

Bug with date filter not taking well formatted dates containing only integer like 2018

Open
#997 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

I will take this opportunity to thank you all for the great work on liquid.
I was reading the documentation here

https://shopify.github.io/liquid/filters/date/

and assumed that the statement

"date works on strings if they contain well-formatted dates:"

meant that any output of the date filter could be used again as input for the date filter. So I expected that this would work and it does

now | date: "%B %Y"

and then something like

"March 2018" | date "%Y"

works and yield 2018 but this does not work

"2018" | date "%Y"

is this a misunderstanding of what is meant by well-formatted dates or it should work?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the date filter documentation linked in the issue and reproduce the examples for "March 2018" and "2018". The payload names no source file or test; done means the handling of integer-only date strings is resolved and the documentation or behavior clearly agrees with the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.