How to use date picker in Angular 2? How to use date picker in Angular 2? angular angular

How to use date picker in Angular 2?


In fact, you can use a datepicker by simply adding the date value into the type attribute of your inputs:

<input type="date" [(ngModel)]="company.birthdate"/>

In some browsers like Chrome and Microsoft Edge (not in Firefox), you can click on the icon within the input to display the date picker. Icons appear only when you mouse is over the input.

To have something cross browsers, you should consider to use Angular2 compliant libraries like:


As answered by @thierry yes there is option for us to use

<input type="date" [(ngModel)]="company.birthdate"/>

for getting date for our project. but yes this is not compatible for the multi browser plateform (like mozila) and there are many cross browser library for the same.

I have made two stylish calendar Datepickers using Bootflat theme which is responsive too refer here

https://github.com/MrPardeep/Angular2-DatePicker

enter image description here

hope this gives you more stylish and multi browser datepicker.