Skip to content

lsr57/datepicker-for-ng2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datepicker-for-ng2

Date picker made with AngularJS 2.

Use

Example with ngModel

<ba-input-datepicker
          [(value)] = "date" /*ngModel */
          labelText="label before input"
          format="date format in input (moment)"
          topClass="class of the top of calendar (month + arrows)"
          dayBarClass="class of the block with the day names"
          gridClass="class of the calendar grid"
          placeholder="placeholder of the input"
          ngDefaultControl>
</ba-input-datepicker>

Example with formControl

<form [formGroup]="form">
    <ba-input-datepicker
      [formControl]="dateCtrl"
      labeltext="Test"
      ngDefaultControl>
    </ba-input-datepicker>
</form>
@Component({
    (...)
})
export class ImplementationExample {
    private form: FormGroup;
    private dateCtrl: FormControl;
    
    constructor(private _formBuilder: FormBuilder) {}
    
    ngOnInit(): void {
        this.dateCtrl = this._formBuilder.control(moment(), Validators.required);
        this.form = this._formBuilder.group({
          date: this.dateCtrl
        });
    }
}

About

datepicker made with angularJS 2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published