0.0.1 • Published 5 years ago

anglar-datepicker v0.0.1

Weekly downloads
3
License
-
Repository
-
Last release
5 years ago

Datepicker

Installation

To install this library, run:

$ npm install anglar-datepicker --save

Consuming your library

Add the below line in app.module.ts
  import { AngularDatepickerModule } from 'anglar-datepicker';
And this import in app.module.ts
imports: [
    BrowserModule,
    AngularDatepickerModule, <-- here
    CommonModule,
    FormsModule
  ],

How to use it for Model based input

<anglar-datepicker 
[position]="'top'" 
[dateFormat]="'DD-MM-YYYY'" 
(onDateSelction)="getDateObject($event)" 
 [(ngModel)]="myInput"></anglar-datepicker>

How to use it for Reactive form based input

<form [formGroup]="myfrmGroup">
 <anglar-datepicker 
  [position]="'top'" 
[dateFormat]="'DD-MM-YYYY'" 
(onDateSelction)="getDateObject($event)" 
formControlName="myInput" ></anglar-datepicker>

</form>

Input and Output

  • @Input - position (optional) - bottom | top | left | right - Default bottom
  • @input - dateFormat (optional) - Any Moment Js based date format - Default DD-MMM-YYYY
  • @output - onDateSelect - Outputs Moment Object

LICENSE

It currently supports ngModel in the text input element and the support for reactiveform is pending still.

License

MIT © Sudhakar Pilavadi

Keywords

Angular Datepicker, Angular 6 Datepicker, Angular 7 Datepicker, Angular 5 Datepicker

0.0.1

5 years ago