fingerpich / jalali-angular-datepicker

Highly configurable jalali (shamsi, khorshidi, persian) date picker built for Angular ( 2 or more ) applications
https://fingerpich.github.io/jalali-angular-datepicker/
MIT License
152 stars 60 forks source link

upgrade to angular 8 and using Ivy #110

Closed MetaiR closed 4 years ago

MetaiR commented 5 years ago

hi, I got this error after updated my project to angular 8 and enabling Ivy compiler:

ERROR in node_modules/ng2-jalali-date-picker/date-picker.module.d.ts(7,22): error TS-996002: Appears in the NgModule.imports of UserDetailsModule, but could not be resolved to an NgModule class
src/__ng_typecheck__.ts(33,60): error TS2344: Type '"_modal"' does not satisfy the constraint '"onClick"'.
fingerpich commented 5 years ago

Hi thanks, I haven't tested it with angular 8 yet can you provide a demo in stackblitz?

MetaiR commented 5 years ago

I can't because it wont be compiled and the error I sent, happened on compile time

fingerpich commented 5 years ago

If you found the solution please create a PR.

MetaiR commented 5 years ago

it is something about the code, I think u must update it

fingerpich commented 5 years ago

We are here to collaborate and improve the project together

faridv commented 4 years ago

I just updated my project to Angular 9 and since Ivy is the default rendering engine and Renderer is no longer available my project doesn't work anymore. As far as I know, migrating from Renderer to Renderer2 is not an issue. Can you please update to Renderer2?

faridv commented 4 years ago

I think this link might help: https://angular.io/guide/migration-renderer

khalilifar commented 4 years ago

My project broke too after upgrading to angular 9 I see there is also a pull request to solve this problem it's not much work mostly done by angular cli. can you please update the project to work with angular 9.

fingerpich commented 4 years ago

It has been fixed through #121 #122 #127 Have you installed v2.4.2?

khalilifar commented 4 years ago

Yes, I have. The problem still exists. I even checked with a fresh angular 9 project to make sure the problem is not just related to my project. It also seems the jalali-moment library is broken as well. it gives the below error.

ERROR TypeError: Cannot read property 'calSystem' of undefined
    at isInputJalali (jalali-moment.js:579)
    at makeMoment (jalali-moment.js:590)
    at jMoment (jalali-moment.js:672)
    at UtilsService.getDefaultDisplayDate (ng2-jalali-date-picker.js:432)
    at DatePickerComponent.init (ng2-jalali-date-picker.js:1772)
    at DatePickerComponent.ngOnInit (ng2-jalali-date-picker.js:1696)
    at callHook (core.js:4726)
    at callHooks (core.js:4690)
    at executeInitAndCheckHooks (core.js:4630)
    at refreshView (core.js:12013)

can you maybe clone the empty ng9 project that I created and see if you can get it to work? you might also want to check out this pull request

fingerpich commented 4 years ago

sorry I don't use this package anymore and i cant spend enough time for this but i fixed the problem with jalali-moment the mentioned PR has too much changes and i couldn't test it completely, if you can fix the problems please let me know zarei.bs@gmail.com

khalilifar commented 4 years ago

@fingerpich Hey, it seems the problem is solved. looks like it was jalali-moment package and not the date-picker. Thanks a lot