eureka2 / ab-datepicker

An accessible and bootstrap compatible datepicker
MIT License
63 stars 55 forks source link

Angular8 #67

Open Maurino5 opened 3 years ago

Maurino5 commented 3 years ago

How can this datepicker be integrated into a SPA with Angular8? By creating a form with the datepicker, the form element is not updated when you click on the date, but only by writing the date by hand.

eureka2 commented 3 years ago

Sorry, I don't know Angular at all!

Maybe someone else can help you.

Maurino5 commented 3 years ago

Actually, I don't think the problem is related to Angular itself, but it seems it's something in the "onUpdate" method...as I found looking around..

Anyway, I post the workaround I used for Angular, in case anyone is interested. Creation of the datepicker must be in the ngOnInit and must implement the onUpdate....something like this:

$('#datepicker').datepicker({ onUpdate: (v) => this.onChange(v) } });

Hope this could be useful.

polaroffer commented 3 years ago

for angular, you can use

  1. ngb datepicker https://ng-bootstrap.github.io/#/components/datepicker/examples; or
  2. angular material date picker