Closed roddc closed 2 years ago
Is there some errors in Console? You can check the demo codes here.
It will throw error if I don't import MtxNativeDatetimeModule
, I imported the module, but the format is still the same. Do I have to provide { provide: DateAdapter, useClass: MomentDateAdapter, }, { provide: DatetimeAdapter, useClass: MomentDatetimeAdapter, }
? I don't see these provides in the docs.
I am not sure is it because I imported MatDatepickerModule
as well.
I created an online example.
Seem work on Angular v12 but didn't work on v13 https://angular-be83mm-5yyams.stackblitz.io
Seem work on Angular v12 but didn't work on v13 https://angular-be83mm-5yyams.stackblitz.io
The demo is v13. I'm not sure where has the problems, maybe you should provide some testing codes.
I had the same error and after quite a bit of research it turns out that by adding
{ provide: DateAdapter, useClass: MomentDateAdapter }
it works as expected.
I had the same error and after quite a bit of research it turns out that by adding
{ provide: DateAdapter, useClass: MomentDateAdapter }
it works as expected.
I had to also install @angular/material-moment-adapter
and @ng-matero/extensions-moment-adapter
to use the adapter.
I followed @nzbin's above link after installing these to make it work as I wanted.
OK perhaps the solution is outdated now. But, from what I can understand, the solution works only with Moment.js-based adapter, i.e.: @angular/material-moment-adapter and @ng-matero/extensions-moment-adapter (MtxMomentDatetimeModule), and it fails with the native MtxNativeDatetimeModule.
I want to customize the datetime input display, but it is not working, I copy the example from the docs.