Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Commit d58d3db

Browse files
committed
Merge pull request #33 from malliapi/master
DefaultText prop addition
2 parents 58d45af + 547b92d commit d58d3db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DateTimeField.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ DateTimeField = React.createClass({
1414
onChange: React.PropTypes.func,
1515
format: React.PropTypes.string,
1616
inputFormat: React.PropTypes.string,
17-
inputProps: React.PropTypes.object
17+
inputProps: React.PropTypes.object,
18+
defaultText: React.PropTypes.string
1819
},
1920
getDefaultProps: function() {
2021
return {
@@ -41,7 +42,7 @@ DateTimeField = React.createClass({
4142
},
4243
viewDate: moment(this.props.dateTime, this.props.format, true).startOf("month"),
4344
selectedDate: moment(this.props.dateTime, this.props.format, true),
44-
inputValue: moment(this.props.dateTime, this.props.format, true).format(this.props.inputFormat)
45+
inputValue: typeof this.props.defaultText != 'undefined' ? this.props.defaultText : moment(this.props.dateTime, this.props.format, true).format(this.props.inputFormat)
4546
};
4647
},
4748
componentWillReceiveProps: function(nextProps) {

0 commit comments

Comments
 (0)