Giter Site home page Giter Site logo

Comments (9)

tgjones avatar tgjones commented on June 9, 2024

Hi Jaben,

I've think I've found the place in the docs that you're referring to, but I'm not sure that snippet of code actually works. I've tried it locally, using Liquid, and it doesn't parse 'now' into a date. In which case, I assume it's just an oversight / bit of optimism on the part of whoever wrote that page.

If that's the case, then I'd rather keep compatibility with Liquid and leave it as it is.

Tim

from dotliquid.

Jaben avatar Jaben commented on June 9, 2024

I see. I guess a nowdate() helper function could be added.

from dotliquid.

dcs619 avatar dcs619 commented on June 9, 2024

I realize this issue is 4 years old, but the official repo now supports using 'now' or 'today' in Liquid markup: Shopify/liquid@8ca4868#diff-844406140a08cdeddd843cfbdf0222d6R183

Edit: I just needed to add the date format. {{ 'Now' | Date:'MM/dd/yy' }} gives me what I needed.

from dotliquid.

rdumont avatar rdumont commented on June 9, 2024

Since Liquid has had this implemented for almost two years now, we really should consider also adding support to now and today.

from dotliquid.

dcs619 avatar dcs619 commented on June 9, 2024

@rdumont Did you see my comment? Now and Today are supported.

from dotliquid.

rdumont avatar rdumont commented on June 9, 2024

@dcs619 I don't think they are, not by DotLiquid. I just tested this with DotLiquid's master branch.

from dotliquid.

canerelci avatar canerelci commented on June 9, 2024

As @rdumont says, it's not supported by master branch, I have a quick implementation of 'now' and 'nowutc' in my branch. In fact, 'now' was my reason to create a branch months ago.

'today' would also be nice but I think it will be just an alias for 'now'?

from dotliquid.

haf avatar haf commented on June 9, 2024

Would indeed be nice; PR PR PR ;).

from dotliquid.

sruthicp avatar sruthicp commented on June 9, 2024

{{ 'Now' | Date:'MM/dd/yy' }}

No luck with this. I still get the 'Now' string using this.

from dotliquid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.