File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -250,18 +250,19 @@ export default class DateTimePicker extends PureComponent {
250
250
renderClock ( ) {
251
251
const { isClockOpen } = this . state ;
252
252
253
- if ( isClockOpen === null ) {
254
- return null ;
255
- }
256
-
257
253
const {
258
254
clockClassName,
259
255
className : timePickerClassName , // Unused, here to exclude it from clockProps
260
256
maxDetail,
261
257
onChange,
258
+ disableClock,
262
259
...clockProps
263
260
} = this . props ;
264
261
262
+ if ( isClockOpen === null || disableClock ) {
263
+ return null ;
264
+ }
265
+
265
266
const className = 'react-datetime-picker__clock' ;
266
267
267
268
const maxDetailIndex = allViews . indexOf ( maxDetail ) ;
@@ -346,6 +347,7 @@ DateTimePicker.defaultProps = {
346
347
isCalendarOpen : null ,
347
348
isClockOpen : null ,
348
349
maxDetail : 'minute' ,
350
+ disableClock : false ,
349
351
} ;
350
352
351
353
DateTimePicker . propTypes = {
@@ -369,6 +371,7 @@ DateTimePicker.propTypes = {
369
371
isCalendarOpen : PropTypes . bool ,
370
372
isClockOpen : PropTypes . bool ,
371
373
maxDetail : PropTypes . oneOf ( allViews ) ,
374
+ disableClock : PropTypes . bool ,
372
375
maxDate : isMaxDate ,
373
376
minDate : isMinDate ,
374
377
name : PropTypes . string ,
You can’t perform that action at this time.
0 commit comments