Skip to content

Commit

Permalink
Merge pull request #147 from AurelicButter/fix/961
Browse files Browse the repository at this point in the history
[Fix/961] Fixed Issue With New Release Dates Not Displaying on Correction Form
  • Loading branch information
AurelicButter authored May 17, 2024
2 parents 3aa6eeb + 4a77249 commit 0b6fe72
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
color: inherit;
}

.center-text {
text-align: center;
}

.correction-input, .old-data-display {
height: 40px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h2>Correction for ISBN <a class="hidden-link" href="/book/{{correctionData.isbn
<div class="correction-comparison">
<div class="correction-field">
<label class="correction-label-inner">New</label>
<input class="form-control correction-input" type="date" name="releaseDate" [(ngModel)]="correctionData.release_date" disabled>
<input class="form-control correction-input center-text" type="date" name="releaseDate" [value]="releaseDateDisplay" [(ngModel)]="releaseDateDisplay" disabled>
</div>
<div class="correction-field" *ngIf="bookData">
<label class="correction-label-inner">Current</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class BookCorrectionComponent implements OnInit {
formats: BookFormat[];
publishers: ImprintData[];
correctionDescription = new FormControl("");
releaseDateDisplay: string;

constructor(
private service: MynewormAPIService,
Expand Down Expand Up @@ -61,6 +62,12 @@ export class BookCorrectionComponent implements OnInit {
this.correctionDescription.setValue(this.correctionData.description);
}

if (this.correctionData.release_date !== undefined) {
this.releaseDateDisplay = moment(this.correctionData.release_date.split("T")[0]).format(
"YYYY-MM-DD"
);
}

this.service.getUserByID(correction.submitter_id.toString()).subscribe((user) => {
if (user === null) {
this.submitterUsername = `Removed User (ID:${correction.submitter_id})`;
Expand Down
2 changes: 1 addition & 1 deletion src/app/models/BookCorrection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface BookCorrectionEntry {
cover_image?: string;
format_name?: string;
book_type?: string;
release_date?: Date;
release_date?: string;
publisher_id?: number;
series_id?: number;
comment?: string;
Expand Down

0 comments on commit 0b6fe72

Please sign in to comment.