File tree Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,19 @@ import rangePlugin from "flatpickr/dist/plugins/rangePlugin";
21
21
import flatpickr from "flatpickr" ;
22
22
import { NG_VALUE_ACCESSOR } from "@angular/forms" ;
23
23
import { carbonFlatpickrMonthSelectPlugin } from "./carbon-flatpickr-month-select" ;
24
- import * as languages from "flatpickr/dist/l10n/index" ;
24
+ import languages from "flatpickr/dist/l10n/index" ;
25
25
import { DatePickerInput } from "carbon-components-angular/datepicker-input" ;
26
- import { ElementService } from "carbon-components-angular/utils" ;
27
26
import { I18n } from "carbon-components-angular/i18n" ;
28
27
28
+ // Due to type error, we have to use square brackets property accessor
29
+ ( languages . default [ "en" ] . weekdays . shorthand as string [ ] )
30
+ = languages . default [ "en" ] . weekdays . longhand . map ( day => {
31
+ if ( day === "Thursday" ) {
32
+ return "Th" ;
33
+ }
34
+ return day . charAt ( 0 ) ;
35
+ } ) ;
36
+
29
37
/**
30
38
* [See demo](../../?path=/story/components-date-picker--single)
31
39
*/
@@ -101,8 +109,7 @@ export class DatePicker implements
101
109
OnDestroy ,
102
110
OnChanges ,
103
111
AfterViewChecked ,
104
- AfterViewInit ,
105
- AfterContentInit {
112
+ AfterViewInit {
106
113
private static datePickerCount = 0 ;
107
114
108
115
/**
@@ -330,16 +337,6 @@ export class DatePicker implements
330
337
}
331
338
}
332
339
333
- ngAfterContentInit ( ) {
334
- ( languages . default . en . weekdays . shorthand as string [ ] )
335
- = languages . default . en . weekdays . longhand . map ( day => {
336
- if ( day === "Thursday" ) {
337
- return "Th" ;
338
- }
339
- return day . charAt ( 0 ) ;
340
- } ) ;
341
- }
342
-
343
340
@HostListener ( "focusin" )
344
341
onFocus ( ) {
345
342
// Updates the month manually when calendar mode is range because month
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ export default {
17
17
invalid : false ,
18
18
warnText : "This is a warning" ,
19
19
warn : false ,
20
- disabled : false
20
+ disabled : false ,
21
+ language : "en"
21
22
} ,
22
23
argTypes : {
23
24
theme : {
You can’t perform that action at this time.
0 commit comments