Skip to content

Adding time handling to existing date filter input for format_string#7

Merged
benfaerber merged 1 commit intobenfaerber:masterfrom
girvo:time_handling_for_date
Apr 1, 2026
Merged

Adding time handling to existing date filter input for format_string#7
benfaerber merged 1 commit intobenfaerber:masterfrom
girvo:time_handling_for_date

Conversation

@girvo
Copy link
Copy Markdown
Contributor

@girvo girvo commented Apr 1, 2026

Hi there! Apologies for the drive-by PR; no sweat if this isn't really what you're after :)

I am using Liquid_ml with a little static-site generator/blog thing to learn Ocaml, it's awesome! One thing I came across though is that the input | date format seems to only accept YYYY-MM-DD in, so I can't pass it a timestamp without constructing a Calendar and feeding it in as String:

let date = CalendarLib.Printer.Calendar.from_fstring "%FT%T" post.meta.date in
Ctx.add "date" (Date date)

Now this is totally fine and again, probably what I'm expected to do here, but I thought I'd take a crack at adding time handling in for bare String val's passed to Ctx and handed to the | date filter as well!

No expectation of this being merged or anything, I am very new to OCaml too so apologies if my code is crap as well, but figured I'd send a PR through in case this was at all useful to anyone else

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@benfaerber
Copy link
Copy Markdown
Owner

Nice! Thanks for the PR. Feel free to add more if you come up with any ideas / things that would help your use case. This will go out in the next release!

@benfaerber benfaerber merged commit 612a2d2 into benfaerber:master Apr 1, 2026
3 checks passed
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.

2 participants