A powerful, customizable Angular date range picker built with Angular 17+ and Day.js.
- 🔥 Clean and modern date range selection
- 📅 Supports predefined and custom ranges
- 🎨 Fully customizable styles
- 🔄 Two-way binding with
FormControl
andngModel
- 🧩 Lightweight (uses Day.js)
Install via npm:
npm install ngx-daterangepicker-pro dayjs
import { NgxDaterangePickerProDirective } from 'ngx-daterangepicker-pro';
@NgModule({
imports: [NgxDaterangePickerProDirective]
})
export class AppModule {}
import { Component } from '@angular/core';
import { NgxDaterangePickerProDirective } from 'ngx-daterangepicker-pro';
@Component({
standalone: true,
selector: 'app-root',
imports: [NgxDaterangePickerProDirective],
templateUrl: './app.component.html'
})
export class AppComponent {}
<form [formGroup]="form">
<input type="text" ngxDaterangePickerPro formControlName="range" />
</form>
<p>
Selected Range:
{{ form.get('range')?.value?.from | date: 'dd/MM/yyyy' }} -
{{ form.get('range')?.value?.to | date: 'dd/MM/yyyy' }}
</p>
import { Component } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
import { DateRangeModel } from 'ngx-daterangepicker-pro';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
form = new FormGroup({
range: new FormControl<DateRangeModel>({ from: null, to: null })
});
}
To run the demo app locally:
npm install
ng serve
Then open http://localhost:4200 in your browser.
To build the library:
ng build ngx-daterangepicker-pro
The output will be located in the dist/ngx-daterangepicker-pro/
folder.
To run unit tests:
ng test
Contributions are welcome! Found a bug or want to suggest a feature?
- Fork the repo
- Create your branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m 'feat: add new feature'
- Push to the branch:
git push origin feature/your-feature-name
- Open a Pull Request
If you encounter any issues or have questions, please open an issue.
This project is licensed under the MIT License.