Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[240] Accept dates without time #242

Merged
merged 1 commit into from
Nov 19, 2022
Merged

[240] Accept dates without time #242

merged 1 commit into from
Nov 19, 2022

Conversation

bkiers
Copy link
Owner

@bkiers bkiers commented Nov 19, 2022

Ruby accepts dates without time:

require 'liquid'

tests = [
  '{{ "2022-10-13 12:06:04" | date: "%m-%e" }}',
  '{{ "2022-10-13" | date: "%m-%e" }}',
  '{{ "13-10-2022" | date: "%m-%e" }}'
]

tests.each { |test|
  @template = Liquid::Template.parse(test)
  puts @template.render
}

results in:

10-13
10-13
10-13

With this change, Liqp produces the same output.

Fixes #240

@bkiers bkiers requested a review from msangel November 19, 2022 10:04
@msangel msangel merged commit 1900a45 into master Nov 19, 2022
@msangel msangel deleted the 240-accept-date-only branch November 19, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parsing Datetime to date-month works fine but not with only Date
2 participants