Skip to content

Instantly share code, notes, and snippets.

@Ollo
Created December 16, 2014 15:50
Show Gist options
  • Save Ollo/3ecc385b45becca0d709 to your computer and use it in GitHub Desktop.
Save Ollo/3ecc385b45becca0d709 to your computer and use it in GitHub Desktop.
ng-moment-wrapper.js
define([
'angular',
'moment'
], function(angular, moment) {
'use strict';
angular.module('common.moment', [])
.factory('dateService', function() {
return moment;
})
.filter('dobTransform', function(dateService) {
return function(input) {
var m = moment(input);
return m.format("MMMM Do, YYYY");
};
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment