Comments (9)
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.
I see. I guess a nowdate() helper function could be added.
from dotliquid.
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.
Since Liquid has had this implemented for almost two years now, we really should consider also adding support to now
and today
.
from dotliquid.
@rdumont Did you see my comment? Now and Today are supported.
from dotliquid.
@dcs619 I don't think they are, not by DotLiquid. I just tested this with DotLiquid's master branch.
from dotliquid.
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.
Would indeed be nice; PR PR PR ;).
from dotliquid.
{{ 'Now' | Date:'MM/dd/yy' }}
No luck with this. I still get the 'Now' string using this.
from dotliquid.
Related Issues (20)
- Website http://dotliquidmarkup.org/ doesn't load HOT 1
- Map Filter Unnamed Property Incorrect Result HOT 1
- Blank Condition Test
- CSharpNamingConvention causes bugs HOT 1
- DotLiquid string array contains returns true for substring HOT 1
- Slice not working as expected HOT 1
- How to get the list of variables used in a liquid template? HOT 3
- IndexOutOfRangeException HOT 2
- Accessing a 2nd level nested array element in dotliquid Json to Json transform step throws undefined, undefined error HOT 1
- Inconsistent rendering of arrays when done directly vs in a Sort filter HOT 8
- Dotliquid not parsing object array in liquid template
- Unsupported type DateOnly in .Net 7.0+
- Dotliquid Ignored CultureInfo settings if CultureInfo.CurrentCulture is InvariantCulture HOT 1
- Empty string / null check not working HOT 9
- Concurrent Access Error in RegisterSafeType Method HOT 3
- Line breaks in literal strings fail to parse HOT 1
- base64_encode / base64_decode filters HOT 2
- [Question] Variable.Render spends most of the time in ToList operation HOT 3
- Unable to compare Guid type in the template
- Template Filters/Tags not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotliquid.