samuelnygaard/ng2-timezone-selector

Not working with angular 7

Opened this issue · 5 comments

Firstly, thanks for a great library

I tried upgrading my angular 6 app to angular 7 and got the following error
Package "ng2-timezone-selector" has an incompatible peer dependency to "rxjs" (requires "^5.1.0", would install "6.3.3").
Package "ng2-timezone-selector" has an incompatible peer dependency to "@angular/core" (requires ">=6.0.0-rc.0 <7.0.0||>=4.0.0 <5.0.0||>=5.0.0 <6.0.0", would install "7.0.2").
Incompatible peer dependencies found. See above.

Do you plan on supporting angular 7? thanks

I'm having the same problem going from angular 5 to 6 when running ng update @angular/core. @DavidDon13 sounds like this is working for you for angular 6? The package.json of this project says "@angular/core": "^4.0.0 || ^5.0.0".

I'm having the same problem going from angular 5 to 6 when running ng update @angular/core. @DavidDon13 sounds like this is working for you for angular 6? The package.json of this project says "@angular/core": "^4.0.0 || ^5.0.0".

Yes it worked for me on my angular 6 app. I'm not sure why tbh. I started an angular 6 app from scratch rather than upgrading from angular 5. Maybe that's the difference?

Anyway, I've uninstalled ng2-timezone-selector. It doesn't look like it's being supported anymore. I wrote my own timezone-selector component using moment-timezone and primeng

To upgrade from Angular6 to Angular7, I temporarily removed the package from package.json, did the upgrade, then put it back in. Worked like a charm!

I have been able to get it to work, for the most part, on Angular 7. I started with Angular 7 and just initialized everything following the instructions for Angular 6.

However, I do get an error, "ERROR TypeError: Cannot read property 'iso' of undefined". This always happens if my timezone value is not one of the supported values. The code tries to use the iso value without even looking to see if the search for the timezone was valid or not.

Also, I have very little control on the styling so it doesn't match all my other styling.

I have looked into creating my own, but I don't quite understand how moment-timezone works in retrieving the timezone values. @DavidDon13, would you mind sharing your approach?

+1 for "ERROR TypeError: Cannot read property 'iso' of undefined" - struggling to get rid of it