Skip to content

Commit

Permalink
fixed bad months
Browse files Browse the repository at this point in the history
  • Loading branch information
bobcaprice committed May 30, 2024
1 parent 878e04a commit d8a7828
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/src/app/affiliation/affiliation-update.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@
(change)="onStartDateSelected(true)"
>
<option i18n="@@gatewayApp.assertionServiceAssertion.month.string" [ngValue]="null">Month</option>
<option *ngFor="let month of monthsList" [ngValue]="month[0]">{{ month[1] | localize }}</option>
<option *ngFor="let month of monthsList" [value]="month[0]">{{ month[1] | localize }}</option>
</select>
</div>
<div class="col-md-4 float-left pr-0">
Expand Down
9 changes: 7 additions & 2 deletions ui/src/app/affiliation/affiliation-update.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ export class AffiliationUpdateComponent implements OnInit {
}

updateForm(assertion: IAffiliation) {
console.log('start month is ', assertion.startMonth)
console.log('end month is ', assertion.endMonth)

if (assertion?.id) {
this.editForm.patchValue({
id: assertion.id,
Expand All @@ -227,10 +230,10 @@ export class AffiliationUpdateComponent implements OnInit {
roleTitle: assertion.roleTitle,
url: assertion.url,
startYear: assertion.startYear,
startMonth: parseInt(assertion.startMonth || '') || null,
startMonth: assertion.startMonth,
startDay: assertion.startDay,
endYear: assertion.endYear,
endMonth: parseInt(assertion.endMonth || '') || null,
endMonth: assertion.endMonth,
endDay: assertion.endDay,
orgName: assertion.orgName,
orgCountry: assertion.orgCountry,
Expand All @@ -250,6 +253,8 @@ export class AffiliationUpdateComponent implements OnInit {
ownerId: assertion.ownerId,
})

console.log('form values set, start month is ', this.editForm.get('startMonth')!.value)

this.onStartDateSelected(false)
this.onEndDateSelected(false)
}
Expand Down

0 comments on commit d8a7828

Please sign in to comment.