Client - update date-fns from 1.3.0 to 2.0.1

This commit is contained in:
Sam
2019-08-28 14:38:15 +02:00
parent 318418bd55
commit c0d38094d9
13 changed files with 102 additions and 77 deletions

View File

@ -36,13 +36,13 @@ function Profile ({ message, onDeletePicture, onUploadPicture, user }) {
<div className="col-md-8">
<p>Email: {user.email}</p>
<p>Registration Date: {
format(new Date(user.created_at), 'DD/MM/YYYY HH:mm')
format(new Date(user.created_at), 'dd/MM/yyyy HH:mm')
}
</p>
<p>First Name: {user.first_name}</p>
<p>Last Name: {user.last_name}</p>
<p>Birth Date: {user.birth_date
? format(new Date(user.birth_date), 'DD/MM/YYYY')
? format(new Date(user.birth_date), 'dd/MM/yyyy')
: ''
}
</p>

View File

@ -32,7 +32,7 @@ class ProfileEdit extends React.Component {
Object.keys(user).map(k => user[k] === null
? formData[k] = ''
: k === 'birth_date'
? formData[k] = format(new Date(user[k]), 'YYYY-MM-DD')
? formData[k] = format(new Date(user[k]), 'yyyy-MM-DD')
: formData[k] = user[k])
this.setState({ formData })
}