mattmccray / liquid.js

JavaScript port of Tobias Luetke's Liquid template engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with 'now' in data filter

Joelith opened this issue · comments

Using this string in the template - {{'now' | date: '%d'}} - does not work. I think it's due to this line:

if(!date instanceof Date && input == 'now'){ date = new Date(); }

it should be:

if(!(date instanceof Date) && input == 'now'){ date = new Date(); }

as otherwise it checks whether !date is an instance of Date, not that date is not an instance of Date.

Fix applied and tagged as version 1.2.1.

Thanks.