|
1 | | -import { Component } from '@angular/core'; |
| 1 | +import { registerLocaleData } from '@angular/common'; |
| 2 | +import { Component, OnInit } from '@angular/core'; |
2 | 3 | import { IFormattingOptions } from 'igniteui-angular'; |
| 4 | +import localeDE from '@angular/common/locales/de'; |
| 5 | +import localeFR from '@angular/common/locales/fr'; |
| 6 | +import localeJA from '@angular/common/locales/ja'; |
| 7 | +import localeAR from '@angular/common/locales/ar'; |
| 8 | +import localeZH from '@angular/common/locales/zh'; |
3 | 9 |
|
4 | 10 | @Component({ |
5 | 11 | selector: 'app-monthpicker-sample-3', |
6 | 12 | styleUrls: ['./monthpicker-sample-3.component.scss'], |
7 | 13 | templateUrl: './monthpicker-sample-3.component.html' |
8 | 14 | }) |
9 | | -export class MonthpickerSample3Component { |
| 15 | +export class MonthpickerSample3Component implements OnInit { |
10 | 16 | public formatOptions: IFormattingOptions = { |
11 | 17 | month: 'long' |
12 | 18 | }; |
13 | 19 |
|
14 | 20 | public date = new Date(); |
15 | 21 | public locales = ['en', 'de', 'fr', 'ar', 'zh']; |
16 | 22 | public locale = 'en'; |
| 23 | + |
| 24 | + public ngOnInit(): void { |
| 25 | + registerLocaleData(localeDE); |
| 26 | + registerLocaleData(localeFR); |
| 27 | + registerLocaleData(localeJA); |
| 28 | + registerLocaleData(localeAR); |
| 29 | + registerLocaleData(localeZH); |
| 30 | + } |
17 | 31 | } |
0 commit comments