Closed jaco-terbraak closed 4 years ago
@jaco-terbraak you need to also register it with Angular.
example:
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule, LOCALE_ID } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { OwlDateTimeModule, OwlNativeDateTimeModule } from '../../projects/picker/src/public_api';
import { AppComponent } from './app.component';
import { OWL_DATE_TIME_LOCALE } from '../../projects/picker/src/public_api';
import localeNl from '@angular/common/locales/nl';
import { registerLocaleData } from '@angular/common';
registerLocaleData(localeNl);
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule, BrowserAnimationsModule, FormsModule,
OwlDateTimeModule, OwlNativeDateTimeModule
],
providers: [
{provide: LOCALE_ID, useValue: 'nl-NL' },
{ provide: OWL_DATE_TIME_LOCALE, useValue: 'nl-NL' }
],
bootstrap: [AppComponent]
})
export class AppModule { }
@jaco-terbraak just checking to see if there's an update on this issue / if you have tried the above..
@danielmoncada sorry for not responding.
I had it registered exactly in this way, but it didn't work. Maybe it's relevant to know I was using OwlMomentDateTimeModule
instead of the Native
variant.
I've since moved on to using ng-pick-datetime-ex
, which did work without problems.
@jaco-terbraak yeah that could have been it, as I've seen other issues with usage when mixing the separate adapter package with this package (which should use the internal). I'll close, thanks
Whenever i set the locale using e.g.
{provide: OWL_DATE_TIME_LOCALE, useValue: 'nl'}
I end up with the runtime error as follows: