@@ -51,7 +51,7 @@ export default class Calendar extends React.Component {
51
51
< div className = { styles . month } >
52
52
< a href = 'javascript:;' role = 'button' onClick = { this . handlePrev . bind ( this ) } />
53
53
< a href = 'javascript:;' role = 'button' onClick = { this . handleNext . bind ( this ) } />
54
- < div > { getMonth ( this . state . currentMonth [ getDateMethod ( this . props . local , ' getMonth' ) ] ( ) ) + ' ' + this . state . currentMonth [ getDateMethod ( this . props . local , ' getFullYear' ) ] ( ) } </ div >
54
+ < div > { getMonth ( this . state . currentMonth . getMonth ( ) ) + ' ' + this . state . currentMonth . getFullYear ( ) } </ div >
55
55
</ div >
56
56
) ;
57
57
}
@@ -67,10 +67,10 @@ export default class Calendar extends React.Component {
67
67
renderDays ( ) {
68
68
let isValueMonth = (
69
69
this . props . value &&
70
- this . props . value [ getDateMethod ( this . props . local , 'getFullYear' ) ] ( ) === this . state . currentMonth [ getDateMethod ( this . props . local , ' getFullYear' ) ] ( ) &&
71
- this . props . value [ getDateMethod ( this . props . local , 'getMonth' ) ] ( ) === this . state . currentMonth [ getDateMethod ( this . props . local , ' getMonth' ) ] ( )
70
+ this . props . value [ getDateMethod ( this . props . local , 'getFullYear' ) ] ( ) === this . state . currentMonth . getFullYear ( ) &&
71
+ this . props . value [ getDateMethod ( this . props . local , 'getMonth' ) ] ( ) === this . state . currentMonth . getMonth ( )
72
72
) ;
73
- let offset = this . state . currentMonth [ getDateMethod ( this . props . local , ' getDay' ) ] ( ) ;
73
+ let offset = this . state . currentMonth . getDay ( ) ;
74
74
let days = daysInMonth ( this . state . currentMonth ) ;
75
75
let labels = [ ] ;
76
76
for ( let i = 0 ; i < offset ; i ++ ) {
@@ -81,7 +81,9 @@ export default class Calendar extends React.Component {
81
81
let className = isSelected ? styles . selected : '' ;
82
82
let onChange = this . props . onChange . bind (
83
83
null ,
84
- new Date ( this . state . currentMonth [ getDateMethod ( this . props . local , 'getFullYear' ) ] ( ) , this . state . currentMonth [ getDateMethod ( this . props . local , 'getMonth' ) ] ( ) , i )
84
+ this . props . local ?
85
+ new Date ( this . state . currentMonth . getFullYear ( ) , this . state . currentMonth . getMonth ( ) , i ) :
86
+ new Date ( Date . UTC ( this . state . currentMonth . getFullYear ( ) , this . state . currentMonth . getMonth ( ) , i ) )
85
87
) ;
86
88
labels . push (
87
89
< a href = 'javascript:;' role = 'button' key = { 'day' + i } className = { className } onClick = { onChange } > { i } </ a >
0 commit comments