(posNegDuration, withoutSuffix, locale)
| 4603 | } |
| 4604 | |
| 4605 | function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) { |
| 4606 | var duration = create__createDuration(posNegDuration).abs(); |
| 4607 | var seconds = round(duration.as('s')); |
| 4608 | var minutes = round(duration.as('m')); |
| 4609 | var hours = round(duration.as('h')); |
| 4610 | var days = round(duration.as('d')); |
| 4611 | var months = round(duration.as('M')); |
| 4612 | var years = round(duration.as('y')); |
| 4613 | |
| 4614 | var a = seconds < thresholds.s && ['s', seconds] || |
| 4615 | minutes === 1 && ['m'] || |
| 4616 | minutes < thresholds.m && ['mm', minutes] || |
| 4617 | hours === 1 && ['h'] || |
| 4618 | hours < thresholds.h && ['hh', hours] || |
| 4619 | days === 1 && ['d'] || |
| 4620 | days < thresholds.d && ['dd', days] || |
| 4621 | months === 1 && ['M'] || |
| 4622 | months < thresholds.M && ['MM', months] || |
| 4623 | years === 1 && ['y'] || ['yy', years]; |
| 4624 | |
| 4625 | a[2] = withoutSuffix; |
| 4626 | a[3] = +posNegDuration > 0; |
| 4627 | a[4] = locale; |
| 4628 | return substituteTimeAgo.apply(null, a); |
| 4629 | } |
| 4630 | |
| 4631 | // This function allows you to set a threshold for relative time strings |
| 4632 | function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) { |
no test coverage detected