Skip to content

Commit

Permalink
Merge pull request #388 from chaitrali-r/main
Browse files Browse the repository at this point in the history
DOB Change
  • Loading branch information
Pratikshakhandagale authored Aug 7, 2023
2 parents a9ffd0a + d42cf1a commit 7db1c06
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
32 changes: 30 additions & 2 deletions donor-registry/src/app/forms/forms.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export class FormsComponent implements OnInit {
isVerified: string;
isFormEdited: boolean = false;
eSignWindowClosed: boolean = false;
dateofBirth: any = null;

ngAfterViewChecked() {
this.cdr.detectChanges();
Expand Down Expand Up @@ -182,11 +183,37 @@ export class FormsComponent implements OnInit {
const isAutoFill = localStorage.getItem('isAutoFill');

if (this.tempData) {

if (isAutoFill != "false") {
// (<HTMLInputElement>document.getElementById("formly_20_radio_registrationBy_1_0")).disabled = true;
// (<HTMLInputElement>document.getElementById("formly_20_radio_registrationBy_1_1")).disabled = true;
// (<HTMLInputElement>document.getElementById("formly_20_radio_registrationBy_1_2")).disabled = true;

if (this.tempData.yearOfBirth || this.tempData.monthOfBirth || this.tempData.dayOfBirth)
{
if(this.tempData.yearOfBirth == null){
this.tempData.yearOfBirth = "yyyy"
}else{
this.tempData.yearOfBirth = this.tempData.yearOfBirth;
}
if(this.tempData.dayOfBirth == null){
this.tempData.dayOfBirth = "dd"
}else {
this.tempData.dayOfBirth = ('0' + this.tempData?.dayOfBirth).slice(-2)
}
if(this.tempData.monthOfBirth == null){
this.tempData.monthOfBirth = "mm"
}
else{
this.tempData.monthOfBirth = ('0' + this.tempData?.monthOfBirth).slice(-2);
}
this.dateofBirth = this.tempData.yearOfBirth + "-" + this.tempData.monthOfBirth + "-" + this.tempData.dayOfBirth
console.log(this.dateofBirth);
}
if(this.tempData?.yearOfBirth && this.tempData?.monthOfBirth && this.tempData?.dayOfBirth){
this.dateofBirth = this.tempData?.yearOfBirth + "-" + ('0' + this.tempData?.monthOfBirth).slice(-2) + "-" + ('0' + this.tempData?.dayOfBirth).slice(-2)
}


this.model = {
...this.model,
"personalDetails": {
Expand All @@ -197,7 +224,8 @@ export class FormsComponent implements OnInit {
"gender": (this.tempData?.gender) ? `${GenderMap[this.tempData?.gender]}` : {},
"emailId": (this.tempData?.email) ? this.tempData?.email : "",
"mobileNumber": this.tempData?.mobile,
"dob": this.tempData?.yearOfBirth + "-" + ('0' + this.tempData?.monthOfBirth).slice(-2) + "-" + ('0' + this.tempData?.dayOfBirth).slice(-2)
"dob":this.dateofBirth


},
"addressDetails": {
Expand Down
2 changes: 0 additions & 2 deletions donor-registry/src/assets/config/ui-config/forms.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@
},
{
"name": "dob",
"type": "date",
"class": "col-lg-4 col-sm-12",
"validation": {
"future": false
Expand Down Expand Up @@ -796,7 +795,6 @@
},
{
"name": "dob",
"type": "date",
"class": "col-lg-4 col-sm-12",
"validation": {
"future": false
Expand Down

0 comments on commit 7db1c06

Please sign in to comment.