From 165d2e9b1da2e51392218827ee598243a46e6216 Mon Sep 17 00:00:00 2001 From: vrde Date: Mon, 1 Jun 2015 14:49:13 +0200 Subject: [PATCH] Fix datetime selector --- js/components/ascribe_forms/form_loan.js | 8 +++++--- js/components/ascribe_forms/input_date.js | 18 ++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index be44bb54..9a1cce27 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -108,13 +108,15 @@ ${username}`; submitted={this.state.submitted}/>
- +
@@ -141,4 +143,4 @@ ${username}`; } }); -export default LoanForm; \ No newline at end of file +export default LoanForm; diff --git a/js/components/ascribe_forms/input_date.js b/js/components/ascribe_forms/input_date.js index aa3e9e94..98422c72 100644 --- a/js/components/ascribe_forms/input_date.js +++ b/js/components/ascribe_forms/input_date.js @@ -8,19 +8,15 @@ let InputDate = React.createClass({ mixins : [AlertMixin], getInitialState() { - return {value: '2015-01-01', + return {value: null, alerts: null // needed in AlertMixin }; }, - handleChange(moment_date) { - this.setState({value: moment_date.format("YYYY-MM-DD")}); - }, - isValidDate: function (str) { - return ( - /^[0-9]{4}$/.test(str) && - moment(str, 'YYYY-MM-DD').isValid() - ); + + handleChange(date) { + this.setState({value: date}); }, + render: function () { let className = "form-control input-text-ascribe"; let alerts = (this.props.submitted) ? null : this.state.alerts; @@ -28,7 +24,9 @@ let InputDate = React.createClass({ ); //return ( @@ -50,4 +48,4 @@ let InputDate = React.createClass({ } }); -export default InputDate; \ No newline at end of file +export default InputDate;