Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

100
Vistas
Issue with date pipe in angular for KHMER language
       <span>{{
            value | date: 'E, dd/MM/yyyy':undefined:languageCode
        }}</span>

I have a scenario in which I need to pass the locale code corresponding to Cambodia's KHMER language. I tried multiple locale codes but they didn't work as expected. Could anyone please help me in finding the locale code for the KHMER language of Cambodia?

The above code is working fine for Chinese, English...

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You just to register locale data with km provides on @angular/common/locales

example

On your app.module.ts

import { LOCALE_ID, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';

import { registerLocaleData } from '@angular/common';
import km from '@angular/common/locales/km';

registerLocaleData(km);

import { AppComponent } from './app.component';

@NgModule({
  imports: [BrowserModule, FormsModule],
  declarations: [AppComponent],
  bootstrap: [AppComponent],
  providers: [{ provide: LOCALE_ID, useValue: 'km_KH' }],
})
export class AppModule {}
7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos