Skip to content

Commit e6c8d27

Browse files
mattmilesisimeg
authored andcommitted
Use static property defaultProps instead of getDefaultProps. (arqex#496)
* Use static property defaultProps instead of getDefaultProps. * Use static property defaultProps instead of getDefaultProps. Fix for lint.
1 parent 6e920ab commit e6c8d27

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

DateTime.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,6 @@ var Datetime = createClass({
3232
closeOnTab: TYPES.bool
3333
},
3434

35-
getDefaultProps: function() {
36-
var nof = function() {};
37-
return {
38-
className: '',
39-
defaultValue: '',
40-
inputProps: {},
41-
input: true,
42-
onFocus: nof,
43-
onBlur: nof,
44-
onChange: nof,
45-
onViewModeChange: nof,
46-
timeFormat: true,
47-
timeConstraints: {},
48-
dateFormat: true,
49-
strictParsing: true,
50-
closeOnSelect: false,
51-
closeOnTab: true,
52-
utc: false
53-
};
54-
},
55-
5635
getInitialState: function() {
5736
var state = this.getStateFromProps( this.props );
5837

@@ -448,6 +427,24 @@ var Datetime = createClass({
448427
}
449428
});
450429

430+
Datetime.defaultProps = {
431+
className: '',
432+
defaultValue: '',
433+
inputProps: {},
434+
input: true,
435+
onFocus: function() {},
436+
onBlur: function() {},
437+
onChange: function() {},
438+
onViewModeChange: function() {},
439+
timeFormat: true,
440+
timeConstraints: {},
441+
dateFormat: true,
442+
strictParsing: true,
443+
closeOnSelect: false,
444+
closeOnTab: true,
445+
utc: false
446+
};
447+
451448
// Make moment accessible through the Datetime class
452449
Datetime.moment = moment;
453450

0 commit comments

Comments
 (0)