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

Is there any way to do date arithmetic #214

Closed
skdutta-ga opened this issue Nov 15, 2016 · 2 comments · Fixed by #420
Closed

Is there any way to do date arithmetic #214

skdutta-ga opened this issue Nov 15, 2016 · 2 comments · Fixed by #420

Comments

@skdutta-ga
Copy link

Say I want to subtract a few days to the date, in liquid we can do something like:

my_date | date: "%s" | minus : 604800

is there an equivalent or workaround in dotliquid?

@laedit
Copy link
Contributor

laedit commented Nov 18, 2016

Please, when you report a bug add the error message.
In this case, I think it's because you try to subtract a number to a date.
A pull request would be welcome 😄

@icnocop
Copy link

icnocop commented Oct 25, 2017

Pathoschild.NaturalTimeParser has a plugin for DotLiquid that can do this.

So for example {{ 'today' | as_date | date_offset:'30 days' | date:'yyyy-MM-dd' }}.

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 a pull request may close this issue.

3 participants