File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
projects/igniteui-angular/src/lib/calendar/common Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,11 @@ export abstract class IgxCalendarViewDirective implements ControlValueAccessor {
118118 */
119119 protected _locale = "en" ;
120120
121+ /**
122+ * @hidden
123+ */
124+ protected _defaultLocale = "en" ;
125+
121126 /**
122127 * @hidden
123128 * @internal
@@ -165,7 +170,7 @@ export abstract class IgxCalendarViewDirective implements ControlValueAccessor {
165170 */
166171 @Input ( )
167172 public get locale ( ) : string {
168- return this . _locale ;
173+ return this . _locale || this . _defaultLocale ;
169174 }
170175
171176 /**
@@ -177,11 +182,13 @@ export abstract class IgxCalendarViewDirective implements ControlValueAccessor {
177182 */
178183 public set locale ( value : string ) {
179184 this . _locale = value ;
180- this . initFormatter ( ) ;
181185 }
182186
183187 constructor ( @Inject ( DAY_INTERVAL_TOKEN ) protected dayInterval ?: DayInterval ) {
184- this . initFormatter ( ) ;
188+ this . _defaultLocale = getCurrentI18n ( ) ;
189+ getI18nManager ( ) . onResourceChange ( ( args : ResourceChangeEventArgs ) => {
190+ this . _defaultLocale = args . newLocale ;
191+ } ) ;
185192 }
186193
187194 /**
You can’t perform that action at this time.
0 commit comments