Reputation: 1249
I try to use the materials date picker but have problem using it with another language. Every solution I find says I have to install "material-moment-adapter" and than I have to use the MomentDateAdapter. But although I have managed to install it (had some version problems using Angular 18.2 and it seems to have a newer version) my system does not find the MomentDateAdapter.
What can I do?
Best regards
Parascus
EDIT!!!:
Generally I tried to implement the solution of "https://stackoverflow.com/questions/48710053/day-incorrect-in-angular-material-datepicker?rq=2" regarding the usage of a MomentUtcDateAdapter. I (again?) installed it with the following commands:
npm i @angular/material-moment-adapter
and
npm i angular-moment
both ended with no further warnings or errors.
Afterwards I implemented the suggested Service of the other post/answer and the strange thing is that although I restarted my Visual Studio it still didn't suggest the corresponding imports and classes in auto complete. That's the reason I assumed that it was not working.
Than I tried to copy the import statements from the post/answer and inserted it (bypassing auto complete) and the source was accepted without any further errors.
I still do not know why Visual Studio didn't suggested the classes as it suggested other completions. But the show must go on and I'll keep in mind that sometimes one has to write the code without auto completion.
Upvotes: 0
Views: 34
Reputation: 1249
Closed because the problem was not the code but a wrong display/auto complete list in the IDE.
Upvotes: 0