@@ -248,21 +248,21 @@ export default class DateTimePicker extends PureComponent {
248
248
}
249
249
250
250
renderClock ( ) {
251
+ const { disableClock} = this . props ;
251
252
const { isClockOpen } = this . state ;
252
253
254
+ if ( isClockOpen === null || disableClock ) {
255
+ return null ;
256
+ }
257
+
253
258
const {
254
259
clockClassName,
255
260
className : timePickerClassName , // Unused, here to exclude it from clockProps
256
261
maxDetail,
257
262
onChange,
258
- disableClock,
259
263
...clockProps
260
264
} = this . props ;
261
265
262
- if ( isClockOpen === null || disableClock ) {
263
- return null ;
264
- }
265
-
266
266
const className = 'react-datetime-picker__clock' ;
267
267
268
268
const maxDetailIndex = allViews . indexOf ( maxDetail ) ;
@@ -342,12 +342,11 @@ const ClearIcon = (
342
342
) ;
343
343
344
344
DateTimePicker . defaultProps = {
345
- clearIcon : ClearIcon ,
346
345
calendarIcon : CalendarIcon ,
346
+ clearIcon : ClearIcon ,
347
347
isCalendarOpen : null ,
348
348
isClockOpen : null ,
349
349
maxDetail : 'minute' ,
350
- disableClock : false ,
351
350
} ;
352
351
353
352
DateTimePicker . propTypes = {
@@ -357,22 +356,22 @@ DateTimePicker.propTypes = {
357
356
PropTypes . string ,
358
357
PropTypes . arrayOf ( PropTypes . string ) ,
359
358
] ) ,
360
- clockClassName : PropTypes . oneOfType ( [
361
- PropTypes . string ,
362
- PropTypes . arrayOf ( PropTypes . string ) ,
363
- ] ) ,
364
359
calendarIcon : PropTypes . node ,
365
360
className : PropTypes . oneOfType ( [
366
361
PropTypes . string ,
367
362
PropTypes . arrayOf ( PropTypes . string ) ,
368
363
] ) ,
369
364
clearIcon : PropTypes . node ,
365
+ clockClassName : PropTypes . oneOfType ( [
366
+ PropTypes . string ,
367
+ PropTypes . arrayOf ( PropTypes . string ) ,
368
+ ] ) ,
370
369
disabled : PropTypes . bool ,
370
+ disableClock : PropTypes . bool ,
371
371
isCalendarOpen : PropTypes . bool ,
372
372
isClockOpen : PropTypes . bool ,
373
- maxDetail : PropTypes . oneOf ( allViews ) ,
374
- disableClock : PropTypes . bool ,
375
373
maxDate : isMaxDate ,
374
+ maxDetail : PropTypes . oneOf ( allViews ) ,
376
375
minDate : isMinDate ,
377
376
name : PropTypes . string ,
378
377
onChange : PropTypes . func ,
0 commit comments