This repository was archived by the owner on May 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class Calendar extends PureComponent {
3838 this . listSizeCache = { } ;
3939 this . isFirstRender = true ;
4040 this . state = {
41- monthNames : [ ... Array ( 12 ) . keys ( ) ] . map ( i => props . locale . localize . month ( i ) ) ,
41+ monthNames : this . getMonthNames ( ) ,
4242 focusedDate : calcFocusDate ( null , props ) ,
4343 drag : {
4444 status : false ,
@@ -48,6 +48,10 @@ class Calendar extends PureComponent {
4848 scrollArea : this . calcScrollArea ( props ) ,
4949 } ;
5050 }
51+ getMonthNames ( ) {
52+ return [ ...Array ( 12 ) . keys ( ) ] . map ( i => this . props . locale . localize . month ( i ) ) ;
53+ }
54+
5155 calcScrollArea ( props ) {
5256 const { direction, months, scroll } = props ;
5357 if ( ! scroll . enabled ) return { enabled : false } ;
@@ -129,7 +133,7 @@ class Calendar extends PureComponent {
129133 if ( this . props . weekStartsOn !== undefined )
130134 this . dateOptions . weekStartsOn = this . props . weekStartsOn ;
131135 this . setState ( {
132- monthNames : [ ... Array ( 12 ) . keys ( ) ] . map ( i => this . props . locale . localize . month ( i ) ) ,
136+ monthNames : this . getMonthNames ( ) ,
133137 } ) ;
134138 }
135139
You can’t perform that action at this time.
0 commit comments