You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 30, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ Note: To use `amFromUnix`, install angular-moment version 1.0.0-beta.3 or newer
112
112
113
113
### amUtc filter
114
114
115
-
Create / switch the current moment object into UTC mode. For example, given a date object in `message.date`,
115
+
Create / switch the current moment object into UTC mode. For example, given a date object in `message.date`,
116
116
the following code will display the time in UTC instead of the local timezone:
117
117
118
118
```html
@@ -134,7 +134,7 @@ Note: To use `amUtcOffset`, install angular-moment version 1.0.0-beta.3 or newer
134
134
135
135
### amLocal filter
136
136
137
-
Changes the given moment object to be in the local timezone. Usually used in conjunction with `amUtc` / `amTimezone`
137
+
Changes the given moment object to be in the local timezone. Usually used in conjunction with `amUtc` / `amTimezone`
138
138
for timezone conversion. For example, the following will convert the given UTC date to local time:
139
139
140
140
```html
@@ -195,8 +195,8 @@ For more information about Moment.JS difference function, see the
195
195
196
196
### amDurationFormat filter
197
197
198
-
Formats a duration (such as 5 days) in a human readable format. See [Moment.JS documentation](http://momentjs.com/docs/#/durations/creating/)
199
-
for a list of supported duration formats, and [`humanize() documentation`](http://momentjs.com/docs/#/durations/humanize/)
198
+
Formats a duration (such as 5 days) in a human readable format. If a display format is provided (as third argument), duration is formatted according to this argument instead of being humanized. See [Moment.JS documentation](http://momentjs.com/docs/#/durations/creating/)
199
+
for a list of supported duration formats, and [`humanize() documentation`](http://momentjs.com/docs/#/durations/humanize/)
200
200
for explanation about the formatting algorithm.
201
201
202
202
Example:
@@ -207,6 +207,11 @@ Example:
207
207
208
208
Will display the age of the message (e.g. 10 minutes, 1 hour, 2 days, etc).
209
209
210
+
```html
211
+
<span>Next train in {{train.nextDuration | amDurationFormat : 'seconds':undefined:'minutes' }} minutes</span>
212
+
213
+
Will display "Next train in 3 minutes" if train.nextDuration is 190.
214
+
210
215
### amSubtract filter
211
216
212
217
Subtract values (hours, minutes, seconds ...) from a specified date.
0 commit comments