import { Component } from '@angular/core' ; import { MAT_MOMENT_DATE_FORMATS , MomentDateAdapter } from '@angular/material-moment-adapter' ; import { DateAdapter , MAT_DATE_FORMATS , MAT_DATE_LOCALE } from '@angular/material/core' ; title @ Component ( { selector : 'datepicker-locale-example' , templateUrl : 'datepicker-locale-example.html' , styleUrls : [ 'datepicker-locale-example.css' ] , providers : [ { provide : MAT_DATE_LOCALE , useValue : 'ja-JP' } , { provide : DateAdapter , useClass : MomentDateAdapter , deps : [ MAT_DATE_LOCALE ] } , { provide : MAT_DATE_FORMATS , useValue : MAT_MOMENT_DATE_FORMATS } , ] , } ) export class DatepickerLocaleExample { constructor ( private adapter ) { } french ( ) { this . adapter . setLocale ( 'fr' ) ; } }