Dates
overlapDuration
Milliseconds shared by two half-open timestamp intervals.
Use it in your component
Standalone component
import { Component } from '@angular/core';
import { OverlapDurationPipe } from 'extra-pipe';
@Component({
standalone: true,
imports: [OverlapDurationPipe],
template: `{{ "2026-01-01T00:00:00Z" | overlapDuration: "2026-01-01T02:00:00Z": "2026-01-01T01:00:00Z": "2026-01-01T03:00:00Z" }}`,
})
export class ExampleComponent {
}
Template
{{ "2026-01-01T00:00:00Z" | overlapDuration: "2026-01-01T02:00:00Z": "2026-01-01T01:00:00Z": "2026-01-01T03:00:00Z" }}
Try it live.
The output below runs the packed library. Edit data, not code.
Use double quotes for text, or a number, array, object or null.
Ordered parameters: end, otherStart, otherEnd. Locale is controlled separately.
This pipe has no locale override.
Live template data
readonly value = "2026-01-01T00:00:00Z";
readonly parameter0 = "2026-01-01T02:00:00Z";
readonly parameter1 = "2026-01-01T01:00:00Z";
readonly parameter2 = "2026-01-01T03:00:00Z";
{{ value | overlapDuration: parameter0: parameter1: parameter2 }}
Rendered output
3600000