Last active
October 5, 2020 06:46
-
-
Save ting11222001/9c2cc0aec359e0134c29cb6c56ca85c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#terminal: | |
$npm install react-datepicker | |
... | |
import DatePicker from 'react-datepicker'; | |
import "react-datepicker/dist/react-datepicker.css"; | |
... | |
render(){ | |
return( | |
<div> | |
... | |
<div className="form-group"> | |
<label>Account Name: </label> | |
<select ref="accountInput" | |
required | |
className="form-control" | |
value={this.state.accountname} | |
onChange={this.onChangeAccountname}> | |
{ | |
this.state.accounts.map(function(account) { | |
return <option | |
key={account} | |
value={account}>{account} | |
</option>; | |
}) | |
} | |
</select> | |
</div> | |
... | |
<div className="form-group"> | |
<label>Date: </label> | |
<div> | |
<DatePicker | |
selected={this.state.date} | |
onChange={this.onChangeDate} | |
/> | |
</div> | |
</div> | |
... | |
</div> | |
); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment