(one: unknown, two: unknown)
| 73 | } |
| 74 | |
| 75 | static compare(one: unknown, two: unknown): -1 | 0 | 1 { |
| 76 | const now = Date.now() |
| 77 | const oneApplied = Math.abs(applyDuration(now, Duration.from(one)).getTime() - now) |
| 78 | const twoApplied = Math.abs(applyDuration(now, Duration.from(two)).getTime() - now) |
| 79 | return oneApplied > twoApplied ? -1 : oneApplied < twoApplied ? 1 : 0 |
| 80 | } |
| 81 | |
| 82 | toLocaleString(locale: string, opts: DurationFormatOptions) { |
| 83 | return new DurationFormat(locale, opts).format(this) |
no test coverage detected