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!










share|improve this question




























    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!










    share|improve this question


























      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!










      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 hours ago









      David Jacquel

      36.4k274104




      36.4k274104










      asked 7 hours ago









      Matthew Hartz

      948




      948





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          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






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Sphinx de Gizeh

          Dijon

          Langue