Angular Datepicker Component
ngx-date-picker is a date-picker component for Angular
https://gnurub.github.io/ngx-datepicker/
Looking for a date range picker? Check this one: https://gnurub.github.io/ngx-daterangepicker/
Install ngx-date-picker via npm
npm install ngx-date-picker-fns --save
// app.module.ts
import { NgxDatePickerModule } from 'ngx-date-picker-fns';
@NgModule({
...
imports: [ NgxDatePickerModule ]
...
})
export class AppModule { }
// app.component.ts
import { Component } from '@angular/core';
import { NgxDatePickerOptions, DateModel } from 'ngx-date-picker-fns';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html'
})
export class AppComponent {
date: DateModel;
options: NgxDatePickerOptions;
constructor() {
this.options = new NgxDatePickerOptions();
}
}
// app.component.html
<ngx-date-picker [options]="options" [(ngModel)]="date"></ngx-date-picker>
For more info about options please see this.
git clone https://github.com/GNURub/ngx-datepicker.git --depth 1
cd ngx-datepicker
npm install
npm start
npm run build:lib
This project is licensed under the MIT license. See the LICENSE file for more info.