Skip to content

Commit

Permalink
Merge pull request #23 from vnts7/tainguyen
Browse files Browse the repository at this point in the history
Fix DoB not display correct after update
  • Loading branch information
vnts7 authored Jun 19, 2019
2 parents 676df31 + 263e8da commit cc6feb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/profile/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ export class ProfileComponent implements OnInit {
this.user = this.authService.user;
this.s.getProfile().subscribe(r => {
const o = r.data;
this.dateOfBirth = o.dateOfBirth ? moment.unix(o.dateOfBirth).format("MM/DD/YYYY") : '';
this.user = o;
this.setFormData(o);
});
}

setFormData(res) {

this.dateOfBirth = res.dateOfBirth ? moment.unix(res.dateOfBirth).format("MM/DD/YYYY") : '';
this.form.controls['weight'].setValue(res.weight)
this.form.controls['height'].setValue(res.height)
// "yyyy-MM-dd" for displaying
Expand Down

0 comments on commit cc6feb4

Please sign in to comment.