ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
393 stars 48 forks source link

Mtx datetime picker | time part is not displayed if date with time was set. #132

Closed IKitcera closed 1 year ago

IKitcera commented 1 year ago

Hello!

I found the issue while was trying to work with your library. It will be very nice if you fix it.

I was working with reactive forms and values are usually sat in onInit or constructor. Unfortunately, mtx datetime picker requires to use AfterViewInit hook to set values. My problem is that time part is not displayed if date with time is set in ctor or ngOnInit

The issue is that this method is not called in necessary place on form values change.

https://github.com/ng-matero/extensions/blob/c8a133ff41f3257678322c8c2ceeaedbd298b84e/projects/extensions/datetimepicker/datetimepicker-input.ts#L406

nzbin commented 1 year ago

Can you give me an online example?

IKitcera commented 1 year ago

@nzbin https://stackblitz.com/edit/angular-ivy-wcvdah?file=src/app/app.component.ts Please notice that I commented 'crutch' directive usage in app.module.ts, which fixed this issue for our project temporary

nzbin commented 1 year ago

Thanks, I have checked your demo and small fix it. It will be ok if you put the input behind the mtx-datetimepicker. https://stackblitz.com/edit/angular-ivy-fs9bma?file=src%2Fapp%2Fapp.component.html

nzbin commented 1 year ago

Duplicate of #100

IKitcera commented 1 year ago

Can you change this order in your demo / documentation to let the future developers not repeat my mistake?

IKitcera commented 1 year ago

Also thank you for quick answer

nzbin commented 1 year ago

The docs has updated and maybe I will improve this issue in the next version.