$.each(data, function () {
var d = new Date(item.created_at.replace('+', 'UTC+'));
var dd = d.format('mediumDate');
var text = '';
if (item.text != null)
text = item.text.linkify();
html += text + '<br/>' + dd + '</div>';
});
I want to make template (emberjs) for it. But I don’t know how to handle property date (dd variable) in the template. How I can do that? Thanks.
Assuming I correctly guessed missing parts, you’ve got a working sample here: http://jsfiddle.net/MikeAski/Pueqb/, which illustrates the case for a single item display.
Handlebars:
JavaScript:
For an array of items, see: http://jsfiddle.net/MikeAski/Pueqb/11/ or http://jsfiddle.net/MikeAski/Pueqb/12/