npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-dual-rangepicker

v0.1.7

Published

Dual calendar date range picker for Angular Material — with presets, month/year selection, and optional time picker

Readme

ngx-dual-rangepicker

Dual-calendar date range picker for Angular 20+ and Angular Material M3.

npm version license


Features

  • Two calendar panels side-by-side (or stacked) with independent navigation
  • Day / Month / Year selection modes — switchable or locked
  • Built-in presets (Today, This week, Last month, This quarter, …)
  • Optional time picker for start and end time
  • Smart overlay positioning — auto-fits to the viewport or use a forced position
  • Hover preview highlights the candidate range as the user moves the cursor
  • Fully accessible — focus trap, role="grid", aria-selected, keyboard navigation
  • Angular Material M3 — styled with M3 tokens, dark mode included
  • Responsive — horizontal layout on wide viewports, vertical on narrow screens
  • Standalone components, no NgModule required

Installation

npm install ngx-dual-rangepicker

The library requires Angular Material and the CDK as peer dependencies:

npm install @angular/material @angular/cdk

Quick Start

1 — Provide a date adapter

In your app.config.ts:

import { provideNativeDateAdapter } from '@angular/material/core';

export const appConfig: ApplicationConfig = {
  providers: [
    // …
    provideNativeDateAdapter(),
  ],
};

2 — Import and use the component

import { NgxDualRangepickerComponent } from 'ngx-dual-rangepicker';
import { DateRange } from '@angular/material/datepicker';

@Component({
  standalone: true,
  imports: [NgxDualRangepickerComponent],
  template: `
    <ngx-dual-rangepicker
      [(selectedRange)]="range"
      (rangeSelected)="onRange($event)"
    />
  `,
})
export class MyComponent {
  range = signal<DateRange<Date> | null>(null);

  onRange(result: DateRangeResult) {
    console.log(result.start, result.end);
  }
}

Inputs

| Input | Type | Default | Description | |---|---|---|---| | selectedRange | DateRange<Date> \| null | null | Current selected range (two-way bindable via model) | | min | Date \| null | null | Minimum selectable date | | max | Date \| null | null | Maximum selectable date | | presets | DateRangePreset[] | built-in 9 | Preset list shown in the sidebar | | showPresets | boolean | true | Show / hide the preset sidebar | | showModeSelector | boolean | true | Show / hide the day/month/year toggle | | selectionMode | 'date' \| 'month' \| 'year' | 'date' | Default active mode | | lockedMode | SelectionMode \| null | null | Force a mode and hide the selector | | enableTimePicker | boolean | false | Enable start/end time inputs | | layout | 'auto' \| 'horizontal' \| 'vertical' | 'auto' | Panel layout | | position | PickerPosition | 'auto' | Overlay position (see below) |

position values

| Value | Behaviour | |---|---| | 'auto' | Tries bottom-start, bottom-end, top-start, top-end — picks the first one that fits | | 'bottom-start' | Below the trigger, aligned left | | 'bottom-end' | Below the trigger, aligned right | | 'top-start' | Above the trigger, aligned left | | 'top-end' | Above the trigger, aligned right |


Outputs

| Output | Type | Description | |---|---|---| | rangeSelected | DateRangeResult | Emitted when the user clicks Apply | | cancelled | void | Emitted when the user clicks Cancel |

DateRangeResult

interface DateRangeResult {
  start: Date;
  end: Date;
  startTime?: TimeValue;  // only when enableTimePicker = true
  endTime?: TimeValue;    // only when enableTimePicker = true
  preset?: string;        // label of the active preset, if any
}

Custom presets

import { DateRangePreset } from 'ngx-dual-rangepicker';
import { DateRange } from '@angular/material/datepicker';

const myPresets: DateRangePreset[] = [
  {
    label: 'Last 7 days',
    range: () => {
      const end = new Date();
      const start = new Date();
      start.setDate(end.getDate() - 6);
      return new DateRange(start, end);
    },
  },
];
<ngx-dual-rangepicker [presets]="myPresets" />

Internationalisation

Override any label by providing DUAL_CALENDAR_INTL:

import { DUAL_CALENDAR_INTL, DualCalendarIntl } from 'ngx-dual-rangepicker';

const myIntl: DualCalendarIntl = {
  applyLabel: 'Valider',
  cancelLabel: 'Annuler',
  daysLabel: 'Jours',
  monthsLabel: 'Mois',
  yearsLabel: 'Années',
  startTimeLabel: 'Heure de début',
  endTimeLabel: 'Heure de fin',
};

// in providers:
{ provide: DUAL_CALENDAR_INTL, useValue: myIntl }

CSS customisation

The component is styled with Angular Material M3 system tokens. You can also override the following custom properties:

| Property | Default | Description | |---|---|---| | --drp-panel-border-radius | 12px | Panel corner radius | | --drp-panel-padding | 16px | Inner padding of the main area | | --drp-preset-width | 168px | Width of the preset sidebar | | --drp-calendar-gap | 16px | Gap between the two calendar panels |


Peer dependencies

| Package | Version | |---|---| | @angular/core | ^20.0.0 | | @angular/common | ^20.0.0 | | @angular/forms | ^20.0.0 | | @angular/cdk | ^20.0.0 | | @angular/material | ^20.0.0 |


License

MIT © Olivier Petitjean