Commit 6862c925 authored by Damien's avatar Damien
Browse files

Fix bug sur la date

parent ab6ba111
......@@ -50,7 +50,7 @@ class FormToucan extends Component {
onDateChange = (event,{value}) =>{
let [day,month,year] = value.split("-")
this.setState({date: new Date(year,month,day)});
this.setState({date: new Date(Date.UTC(year,month-1,day,0,0,0))},()=> console.log(this.state.date.toLocaleDateString()));
}
onSubmit = () => {
......
......@@ -10,15 +10,6 @@ class ToucanLine extends Component {
this.closeModal = this.closeModal.bind(this)
}
date(time){
const dateObject = new Date(time)
const year = dateObject.getFullYear();
const month = dateObject.getMonth();
const day = dateObject.getDay();
return (`${day+1}/${month+1}/${year}`)
}
closeModal() {
this.setState({ isModalOpen: false })
}
......@@ -38,7 +29,7 @@ class ToucanLine extends Component {
{this.props.toucan.title}
</Table.Cell>
<Table.Cell >
{this.date(this.props.toucan.date)}
{(new Date(this.props.toucan.date).toLocaleDateString())}
</Table.Cell>
<Table.Cell style={{width:"fit-content"}}>
<Button negative icon="cancel" onClick={() => this.setState({isModalOpen: true})}/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment