Skip to content

Commit

Permalink
Fix DoB not display correct after update
Browse files Browse the repository at this point in the history
  • Loading branch information
vnts7 committed Jun 19, 2019
1 parent 676df31 commit 263e8da
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 263e8da

Please sign in to comment.