Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 666 Bytes

Readme.md

File metadata and controls

31 lines (27 loc) · 666 Bytes

#AngularJS Moment.js Filter

Installation

AngularJS Moment.js Filter is available on bower:

bower install --save js-angular-moment-filter

Usage

Apply the filter using the default formatting:

<span>{{ date | moment }}</span>
Result: 04/20/2016, 9:39 PM

Apply the filter using custom formatting:

<span>{{ date | moment:'MM/DD/Y' }}</span>
Result: 04/20/2016

Set a different default formatting

app.config(function(momentFilterProvider){
    momentFilterProvider.defaultFormat('dddd, MMMM Do YYYY, h:mm:ss a');
});
<span>{{ date | moment }}</span>
Result: Wednesday, April 20th 2016, 9:47:43 pm