Dotliquid Date Filter
up vote
0
down vote
favorite
I am trying to calculate the days between "now" and a provided date. I found a SO post that seems to do exactly what I am looking for.
Shopify (liquid): Find number of days between two dates
Unfortunately, when i change it for my model I experience problems. After some debugging my guess is it is related to dates with an applied filter, in my situation "minus".
If I do something like:
{{"now" | date: "%s" }}
I get a valid result. But once i apply a filter to it:
{{"now" | date: "%s" | minus: 604800 }}
I get "Liquid error: Parameter count mismatch."
I also made sure that it isn't the minus filter, i tried basic math like:
{{ 100 | minus : 20 }}
and it was successful to print "80".
Is there a setting i am forgetting? I have these settings turned on.
Liquid.UseRubyDateFormat = true;
Template.NamingConvention = new DotLiquid.NamingConventions.RubyNamingConvention();
Thanks!
c# dotliquid
add a comment |
up vote
0
down vote
favorite
I am trying to calculate the days between "now" and a provided date. I found a SO post that seems to do exactly what I am looking for.
Shopify (liquid): Find number of days between two dates
Unfortunately, when i change it for my model I experience problems. After some debugging my guess is it is related to dates with an applied filter, in my situation "minus".
If I do something like:
{{"now" | date: "%s" }}
I get a valid result. But once i apply a filter to it:
{{"now" | date: "%s" | minus: 604800 }}
I get "Liquid error: Parameter count mismatch."
I also made sure that it isn't the minus filter, i tried basic math like:
{{ 100 | minus : 20 }}
and it was successful to print "80".
Is there a setting i am forgetting? I have these settings turned on.
Liquid.UseRubyDateFormat = true;
Template.NamingConvention = new DotLiquid.NamingConventions.RubyNamingConvention();
Thanks!
c# dotliquid
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to calculate the days between "now" and a provided date. I found a SO post that seems to do exactly what I am looking for.
Shopify (liquid): Find number of days between two dates
Unfortunately, when i change it for my model I experience problems. After some debugging my guess is it is related to dates with an applied filter, in my situation "minus".
If I do something like:
{{"now" | date: "%s" }}
I get a valid result. But once i apply a filter to it:
{{"now" | date: "%s" | minus: 604800 }}
I get "Liquid error: Parameter count mismatch."
I also made sure that it isn't the minus filter, i tried basic math like:
{{ 100 | minus : 20 }}
and it was successful to print "80".
Is there a setting i am forgetting? I have these settings turned on.
Liquid.UseRubyDateFormat = true;
Template.NamingConvention = new DotLiquid.NamingConventions.RubyNamingConvention();
Thanks!
c# dotliquid
I am trying to calculate the days between "now" and a provided date. I found a SO post that seems to do exactly what I am looking for.
Shopify (liquid): Find number of days between two dates
Unfortunately, when i change it for my model I experience problems. After some debugging my guess is it is related to dates with an applied filter, in my situation "minus".
If I do something like:
{{"now" | date: "%s" }}
I get a valid result. But once i apply a filter to it:
{{"now" | date: "%s" | minus: 604800 }}
I get "Liquid error: Parameter count mismatch."
I also made sure that it isn't the minus filter, i tried basic math like:
{{ 100 | minus : 20 }}
and it was successful to print "80".
Is there a setting i am forgetting? I have these settings turned on.
Liquid.UseRubyDateFormat = true;
Template.NamingConvention = new DotLiquid.NamingConventions.RubyNamingConvention();
Thanks!
c# dotliquid
c# dotliquid
edited 4 hours ago
David Jacquel
36.4k274104
36.4k274104
asked 7 hours ago
Matthew Hartz
948
948
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53398349%2fdotliquid-date-filter%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown