@@ -360,10 +360,10 @@ export default class DatePicker extends React.Component {
360
360
this . props . openToDate
361
361
? this . props . openToDate
362
362
: this . props . selectsEnd && this . props . startDate
363
- ? this . props . startDate
364
- : this . props . selectsStart && this . props . endDate
365
- ? this . props . endDate
366
- : newDate ( ) ;
363
+ ? this . props . startDate
364
+ : this . props . selectsStart && this . props . endDate
365
+ ? this . props . endDate
366
+ : newDate ( ) ;
367
367
368
368
// Convert the date from string format to standard Date format
369
369
modifyHolidays = ( ) =>
@@ -384,8 +384,8 @@ export default class DatePicker extends React.Component {
384
384
minDate && isBefore ( defaultPreSelection , startOfDay ( minDate ) )
385
385
? minDate
386
386
: maxDate && isAfter ( defaultPreSelection , endOfDay ( maxDate ) )
387
- ? maxDate
388
- : defaultPreSelection ;
387
+ ? maxDate
388
+ : defaultPreSelection ;
389
389
return {
390
390
open : this . props . startOpen || false ,
391
391
preventFocus : false ,
@@ -1175,14 +1175,14 @@ export default class DatePicker extends React.Component {
1175
1175
typeof this . props . value === "string"
1176
1176
? this . props . value
1177
1177
: typeof this . state . inputValue === "string"
1178
- ? this . state . inputValue
1179
- : this . props . selectsRange
1180
- ? safeDateRangeFormat (
1181
- this . props . startDate ,
1182
- this . props . endDate ,
1183
- this . props ,
1184
- )
1185
- : safeDateFormat ( this . props . selected , this . props ) ;
1178
+ ? this . state . inputValue
1179
+ : this . props . selectsRange
1180
+ ? safeDateRangeFormat (
1181
+ this . props . startDate ,
1182
+ this . props . endDate ,
1183
+ this . props ,
1184
+ )
1185
+ : safeDateFormat ( this . props . selected , this . props ) ;
1186
1186
1187
1187
return React . cloneElement ( customInput , {
1188
1188
[ customInputRef ] : ( input ) => {
@@ -1216,6 +1216,7 @@ export default class DatePicker extends React.Component {
1216
1216
renderClearButton = ( ) => {
1217
1217
const {
1218
1218
isClearable,
1219
+ disabled,
1219
1220
selected,
1220
1221
startDate,
1221
1222
endDate,
@@ -1230,7 +1231,12 @@ export default class DatePicker extends React.Component {
1230
1231
return (
1231
1232
< button
1232
1233
type = "button"
1233
- className = { `react-datepicker__close-icon ${ clearButtonClassName } ` . trim ( ) }
1234
+ className = { classnames (
1235
+ "react-datepicker__close-icon" ,
1236
+ clearButtonClassName ,
1237
+ { "react-datepicker__close-icon--disabled" : disabled } ,
1238
+ ) }
1239
+ disabled = { disabled }
1234
1240
aria-label = { ariaLabelClose }
1235
1241
onClick = { this . onClearClick }
1236
1242
title = { clearButtonTitle }
0 commit comments