Moment.JS directives for Angular.JS (timeago and more)
!!! BREAKING CHANGE !!!
Preprocessors, timezones and input format were removed from am-time-ago and all filters. Use the new amFromUnix
, amUtc
, amUtcOffset
, amTimezone
, and amParse
filters instead.
Examples:
<time am-time-ago="myDate" am-format="YYYY-MM-DD">
becomes <time am-time-ago="myDate|amParse:'YYYY-MM-DD'">
<time am-time-ago="myDate" am-preprocess="unix">
becomes <time am-time-ago="myDate|amFromUnix">
{{myDate|amCalendar:'unix'}}
becomes {{myDate|amFromUnix|amCalendar}}
{{myDate|amCalendar:null:'PDT'}}
becomes {{myDate|amTimezone:'PDT'|amCalendar}}
The removal of the preprocessors also affects the other positional parameters of the amTimeAgo
:
{{myDate|amTimeAgo:null:true:fromDate}}
becomes {{myDate|amTimeAgo:true:fromDate}}
.
For more information, please see #174.
amDateFormat
to work with custom formatted input date strings (#162, contributed by jblashka)amAdd
, amSubtract
- add/subtract a value from a given date (#171, contributed by nicholasruggeri)moment
on the global
object (#133, contributed by kitbrennan90)am-from
parameter to the amTimeAgo
directive (#145, contributed by baleato)from
parameter to the amTimeAgo
filter (#146, contributed by pipo02mix)am-time-ago
in favor of AngularJS 1.3's one time binding (#122)am-time-ago
(see #75)amDifference
filter (#120, contributed by ajhodges)amMoment.changeTimezone()
(#92)amMoment.changeLanguage()
. Use amMoment.changeLocale()
instead.amMoment:languageChange
. Listen for amMoment:localeChange
instead.