Angular2 moment provides pipes for using momentjs methods in the angular environment. Make sure to include momentjs and angular tags along with this tag. Use angular-moment tag for the angularjs version of the library.
angular2 moment is a plugin that adds the following pipes to Angular based on the moment.js library.
- Pipes
amTimeAgo
- Use to format relative timeamCalendar
- Format a date using moment.jscalendar()
methodamDateFormat
- Format a date using moment.jsformat()
methodamParse
- Parse a custom-formatted date into a moment objectamFromUnix
- Convert a unix-timestamp into a moment objectamDuration
- Format a duration in a human readable formatamDifference
- Get the difference between two dates in millisecondsamAdd
- Add hours, minutes or seconds from the specified date.amSubtract
- Subtract hours, minutes or seconds from the specified date.amUtc
- Create or switch the current moment object into UTC mode
References
Related Tags