Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

547
Vistas
How to use date picker in Angular 2?

I have tried many date picker in my angular2 app but none of them is working.Although the date picker is displaying on the view but the value of selected date is not getting in the ngModel variable.

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

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:

  • https://github.com/kekeh/mydatepicker
  • https://github.com/jkuri/ng2-datepicker
over 4 years ago · Santiago Trujillo Denunciar

0

PrimeNG also provides a DatePicker component, live demo;

http://www.primefaces.org/primeng/#/calendar

over 4 years ago · Santiago Trujillo Denunciar

0

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.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda