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-4
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ Note: To use `amFromUnix`, install angular-moment version 1.0.0-beta.2
91
91
92
92
### amUtc filter
93
93
94
-
Create / switch the current moment object into UTC mode. For example, given a date object in `message.date`,
94
+
Create / switch the current moment object into UTC mode. For example, given a date object in `message.date`,
95
95
the following code will display the time in UTC instead of the local timezone:
96
96
97
97
```html
@@ -113,7 +113,7 @@ Note: To use `amUtcOffset`, install angular-moment version 1.0.0-beta.2
113
113
114
114
### amLocal filter
115
115
116
-
Changes the given moment object to be in the local timezone. Usually used in conjunction with `amUtc` / `amTimezone`
116
+
Changes the given moment object to be in the local timezone. Usually used in conjunction with `amUtc` / `amTimezone`
117
117
for timezone conversion. For example, the following will convert the given UTC date to local time:
118
118
119
119
```html
@@ -174,8 +174,8 @@ For more information about Moment.JS difference function, see the
174
174
175
175
### amDurationFormat filter
176
176
177
-
Formats a duration (such as 5 days) in a human readable format. See [Moment.JS documentation](http://momentjs.com/docs/#/durations/creating/)
178
-
for a list of supported duration formats, and [`humanize() documentation`](http://momentjs.com/docs/#/durations/humanize/)
177
+
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/)
178
+
for a list of supported duration formats, and [`humanize() documentation`](http://momentjs.com/docs/#/durations/humanize/)
179
179
for explanation about the formatting algorithm.
180
180
181
181
Example:
@@ -186,6 +186,11 @@ Example:
186
186
187
187
Will display the age of the message (e.g. 10 minutes, 1 hour, 2 days, etc).
188
188
189
+
```html
190
+
<span>Next train in {{train.nextDuration | amDurationFormat : 'seconds':undefined:'minutes' }} minutes</span>
191
+
192
+
Will display "Next train in 3 minutes" if train.nextDuration is 190.
193
+
189
194
### amSubtract filter
190
195
191
196
Subtract values (hours, minutes, seconds ...) from a specified date.
0 commit comments