(input: DurationFormat)
| 130 | } |
| 131 | |
| 132 | static durationToMs(input: DurationFormat): number { |
| 133 | const keys = Object.keys(input); |
| 134 | let timestamp = 0; |
| 135 | if (keys.length <= 0) return timestamp; |
| 136 | for (let i = 0; i < keys.length; i++) { |
| 137 | const key = keys[i]; |
| 138 | const value = input[key]; |
| 139 | timestamp += dateUnitToMs[key] * value; |
| 140 | } |
| 141 | return timestamp || 0; |
| 142 | } |
| 143 | |
| 144 | getRelativeText(options: DurationFormatOptions = { style: 'narrow' }): string { |
| 145 | if (!this.duration) return ''; |
no test coverage detected