laktek / punch

A fun and easy way to build modern websites
http://laktek.github.com/punch
MIT License
1.17k stars 107 forks source link

Issues displaying {{date}} #110

Open PatrickHeneise opened 10 years ago

PatrickHeneise commented 10 years ago

Hey,

I have my data in JSON and try to render {{date}}. Doing that gives me an error '[Error: Invalid parameters.]' and a blank site.

laktek commented 10 years ago

Date is a block helper, where you need to provide a time in Unix timestamp format. https://github.com/laktek/punch/wiki/Helpers#wiki-date

How are you trying to use it in your template?

PatrickHeneise commented 10 years ago

Oh, I thought so, but didn't find the page. I have a regular json/iso date string and want to display (formatted) it. JSON is for example "event": {"date": "2014-03-12T09:31:03.455Z"}.