namespaceduration
Source: directives/
angular filter; parses ISO duration (xs:duration
) strings and creates a string description.
Usage: myduration | duration[:options]
For example, "P3Y4M75DT23H31M14.54S" | duration
will produce: "3 years, 4 months, 75 days, 23 hours, 31 minutes, and 14.54 seconds"
Duration properties that aren't present will be suppressed. You can provide translations through the options:
options = {
year: 'year',
years: 'years',
month: 'month',
months: 'months',
week: 'week',
weeks: 'weeks',
day: 'day',
days: 'days',
hour: 'hour',
hours: 'hours',
minute: 'minute',
minutes: 'minutes',
second: 'second',
seconds: 'seconds',
}