question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find "DateAdapter & MD_DATE_FORMATS"

See original GitHub issue

DateAdapter & MD_DATE_FORMATS are not recognized for md-datepicker Here is my code

import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ReactiveFormsModule } from '@angular/forms';
import{
    MdTabsModule,
    MdSidenavModule,
    MdToolbarModule,
    MdMenuModule,
    MdInputModule,
    MdButtonModule,
    MdDatepickerModule,
    MdNativeDateModule,
    MdCheckboxModule,
    MdSelectModule,
} from '@angular/material';
import { AppComponent } from './app.component';
import { SearchComponent, APP_DATE_FORMATS } from './search/search.component';

@NgModule({
    declarations: [
        AppComponent,
        SearchComponent
    ],
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        ReactiveFormsModule,
        MdMenuModule,
        MdSidenavModule,
        MdTabsModule,
        MdToolbarModule,
        MdButtonModule,
        MdDatepickerModule,
        MdInputModule,
        MdNativeDateModule,
        MdCheckboxModule,
        MdSelectModule,
    ],
    schemas: [CUSTOM_ELEMENTS_SCHEMA],
    providers: [{
        provide: DateAdapter, useClass: SearchComponent
    },
    {
        provide: MD_DATE_FORMATS, useValue: APP_DATE_FORMATS
    }
    ],
    bootstrap: [AppComponent]
})
export class AppModule { }

I’m getting cannot find error eventhough I imported “MdDatepickerModule,MdNativeDateModule”

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
divyamehercommented, Jul 20, 2017

import{ MdTabsModule, MdSidenavModule, MdToolbarModule, MdMenuModule, MdInputModule, MdButtonModule, MdDatepickerModule, MdNativeDateModule, MdCheckboxModule, MdSelectModule, } from @angular/material’;

0reactions
angular-automatic-lock-bot[bot]commented, Sep 6, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular material: MatDatepicker: No provider found for ...
Official docs: Error: MatDatepicker: No provider found for DateAdapter/MAT_DATE_FORMATS. The datepicker was built to be date implementation ...
Read more >
No provider found for DateAdapter · Issue #11860 - GitHub
I have a separate Web component project to publish components on private npm (verdaccio). Here is the DatePicker Component details : // ...
Read more >
Error: "MatDatepicker: No provider found for DateAdapter
I am creating Angular Material Datepicker . But getting following error. Error: "MatDatepicker: No provider found for DateAdapter. You must import one of...
Read more >
Datepicker with different locale - StackBlitz
import {DateAdapter, MAT_DATE_FORMATS,. MAT_DATE_LOCALE} from '@angular/material/. core';. /** @title Datepicker with different locale */. @Component({.
Read more >
Datepicker in Angular using mat-datepicker | Material Design
You have to import NativeDateAdapter, DateAdapter, MAT_DATE_FORMATS from angular material. ... Error: MatDatepicker: No provider found for DateAdapter.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found