@@ -29,7 +29,7 @@ class CalendarProvider extends Component {
29
29
date : this . props . date || XDate ( ) . toString ( 'yyyy-MM-dd' ) ,
30
30
updateSource : UPDATE_SOURCES . CALENDAR_INIT ,
31
31
buttonY : new Animated . Value ( - 65 ) ,
32
- buttonIcon : this . getButtonIcon ( props . date ) ,
32
+ buttonIcon : props . showTodayButton && this . getButtonIcon ( props . date ) ,
33
33
disabled : false ,
34
34
opacity : new Animated . Value ( 1 )
35
35
} ;
@@ -45,7 +45,7 @@ class CalendarProvider extends Component {
45
45
} ;
46
46
47
47
setDate = ( date , updateSource ) => {
48
- this . setState ( { date, updateSource} , ( ) => {
48
+ this . setState ( { date, updateSource, buttonIcon : this . props . showTodayButton && this . getButtonIcon ( date ) } , ( ) => {
49
49
this . animateTodayButton ( date ) ;
50
50
} ) ;
51
51
_ . invoke ( this . props , 'onDateChanged' , date , updateSource ) ;
@@ -85,7 +85,6 @@ class CalendarProvider extends Component {
85
85
86
86
animateTodayButton ( date ) {
87
87
if ( this . props . showTodayButton ) {
88
- this . setState ( { buttonIcon : this . getButtonIcon ( date ) } ) ;
89
88
90
89
const today = XDate ( ) . toString ( 'yyyy-MM-dd' ) ;
91
90
const isToday = today === date ;
0 commit comments