Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeLocale #259

Closed
skywalkerdark opened this issue Nov 25, 2019 · 13 comments
Closed

TimeLocale #259

skywalkerdark opened this issue Nov 25, 2019 · 13 comments

Comments

@skywalkerdark
Copy link

ERROR NullInjectorError: R3InjectorError(AppModule)[InjectionToken TimeLocale -> InjectionToken TimeLocale -> InjectionToken TimeLocale]:
NullInjectorError: No provider for InjectionToken TimeLocale!

What is TimeLocale and where can I find it?

@alexander-kiriliuk
Copy link

alexander-kiriliuk commented Nov 29, 2019

You can try import picker-module in your root application module by calling setLocale(). That should work

@Coooi
Copy link

Coooi commented Dec 6, 2019

Thank you @AlexanderKiriluyk , worked perfectly!

@Agranom Agranom closed this as completed Dec 9, 2019
@OLDIN
Copy link

OLDIN commented Mar 13, 2020

I got the same error in angular v9 with ivy and the setLocal method doesn't help me.
installed version : 5.4.2

ERROR NullInjectorError: R3InjectorError(AppModule)[InjectionToken TimeLocale -> InjectionToken TimeLocale -> InjectionToken TimeLocale]: 
  NullInjectorError: No provider for InjectionToken TimeLocale!

@Agranom Agranom reopened this Mar 14, 2020
@OLDIN
Copy link

OLDIN commented Mar 14, 2020

@Agranom Is there any quick workaround?

@Agranom
Copy link
Owner

Agranom commented Mar 14, 2020

Not sure. I'll update to 9 angular this week and check

@Agranom
Copy link
Owner

Agranom commented Mar 17, 2020

Updated the repo to ng9 and checked. Working without errors. You can see it on the demo page

@OLDIN
Copy link

OLDIN commented Mar 17, 2020

@Agranom I see a commit with update. Have you update the NPM version?

@Agranom
Copy link
Owner

Agranom commented Mar 26, 2020

@OLDIN Yes. Try the latest version

@mahdiprog
Copy link

mahdiprog commented Mar 28, 2020

@Agranom I have the same issue on Angular@9.1 and ngx-material-timepicker@5.5.0.
but I used ngx-timepicker-field and @AlexanderKiriluyk's solution not worked for me.
and the v4.0.2 is working

@OLDIN
Copy link

OLDIN commented Mar 31, 2020

Temporary fix, but very badly

This can be fixed by explicitly specifying TIME_LOCALE in your app.module.ts:

{
    provide: TIME_LOCALE,
    useValue: ''
}

Full example with import:

import { ɵe as TIME_LOCALE } from 'ngx-material-timepicker'; // nice import :D

@NgModule({
  imports: [],
  providers: [
    {
      provide: TIME_LOCALE,
      useValue: ''
    }
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}

@Agranom
Copy link
Owner

Agranom commented Apr 28, 2020

@mahdiprog can you provide with a code snippet how you use it, because it works well with ng9 for me

@Agranom
Copy link
Owner

Agranom commented May 2, 2020

For now it fixes by importing NgxMaterialTimepickerModule into a root module

@Agranom
Copy link
Owner

Agranom commented May 11, 2020

Seems to be fixed in v5.5.2

@Agranom Agranom closed this as completed May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants