ember.js - Handlebars helper for date parsing not getting the value -
i started playing around emberjs , handlebars recently, please accept apologies silly question. trying format date shown in template. date in isostring format , trying is:
my template code:
{{parsedate todate}} //todate holds 2013-12-02t22:00:00.000z
and handler code:
handlebars.registerhelper('parsedate', function(value) { console.log(value); //print string "todate" not value of "todate" - isostring return datestring(value) });
i sure simple, not figure out. have looked around did not find solution.
thanks help!
i don't know datestring
function does, helper works fine: http://jsbin.com/odosoy/143/edit
i've changed little, added ember
namespace in front bevor handlebars
, converted bound helper make rerender when todate
property changes:
ember.handlebars.registerboundhelper('parsedate', function(value) { console.log(value); // formatting value // i've commented out since it's not clear // code example datestring function // return datestring(value); return value; });
hope helps.
Comments
Post a Comment