ab-datepicker icon indicating copy to clipboard operation
ab-datepicker copied to clipboard

Angular8

Open Maurino5 opened this issue 4 years ago • 3 comments

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.

Maurino5 avatar Jan 22 '21 08:01 Maurino5

Sorry, I don't know Angular at all!

Maybe someone else can help you.

eureka2 avatar Jan 24 '21 17:01 eureka2

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.

Maurino5 avatar Jan 25 '21 13:01 Maurino5

for angular, you can use

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

polaroffer avatar Apr 08 '21 10:04 polaroffer