Skip to content

Instantly share code, notes, and snippets.

View fabriciotav's full-sized avatar

Fabrício Tavares fabriciotav

View GitHub Profile
@fabriciotav
fabriciotav / date.js
Created April 4, 2014 14:30
Using D3 and Handlebars to deal with date formatting in Ember
Ember.Handlebars.registerBoundHelper('date', function(date, specifier) {
if (arguments.length === 2) specifier = '%Y-%m-%d';
return Object.prototype.toString.call(date) === '[object Date]' ? d3.time.format(specifier)(date) : specifier;
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
node_modules