← All pipes
Dates

dateBucket

UTC start-of-day/week/month/quarter/year for chart grouping.

Use it in your component

Standalone component
import { Component } from '@angular/core';
import { DateBucketPipe } from 'extra-pipe';

@Component({
  standalone: true,
  imports: [DateBucketPipe],
  template: `{{ "2026-05-15T12:30:00Z" | dateBucket: "month" }}`,
})
export class ExampleComponent {

}

Template
{{ "2026-05-15T12:30:00Z" | dateBucket: "month" }}

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: unit. Locale is controlled separately.
This pipe has no locale override.
Live template data
readonly value = "2026-05-15T12:30:00Z";
readonly parameter0 = "month";
{{ value | dateBucket: parameter0 }}

Rendered output

2026-05-01T00:00:00.000Z