Skip to content

Commit

Permalink
URM-180515
Browse files Browse the repository at this point in the history
Cloud App NACSIS-CAT- Display of date in search results not corrected as expected in Sept release
  • Loading branch information
jawanbdarni committed Dec 2, 2024
1 parent 354a12c commit d5ce037
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions cloudapp/src/app/catalog/results-types/monographs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,14 @@ export class MonographSummaryDisplay extends IDisplayLines{
fieldsArray.push(new ViewFieldBuilder().label('Catalog.Results.Book').build());
fieldsArray.push(new ViewFieldBuilder().content(this.record.PUB[0]?.PUBL).build());
fieldsArray.push(new ViewFieldBuilder().label(", ").content(this.record.TTLL).build());
fieldsArray.push(new ViewFieldBuilder().label(": ").content(this.getFirstPriorityDate()).build());
fieldsArray.push(new ViewFieldBuilder().label("- ").content(this.record.YEAR2).build());
//Do not display in case the YEAR ot the PUB DATE are empty or contain non numeric value.
let date : string = this.getFirstPriorityDate();
if(!this.isEmpty(date) && date.match(/^[0-9]+$/)) {
fieldsArray.push(new ViewFieldBuilder().label(": ").content(date).build());
fieldsArray.push(new ViewFieldBuilder().label("- ").content(this.record.YEAR2).build());
}
// let date : string = this.getFirstPriorityDate();
// if(!this.isEmpty(date) && date.match(/^[0-9]+$/)) {
// fieldsArray.push(new ViewFieldBuilder().label(": ").content(date).build());
// fieldsArray.push(new ViewFieldBuilder().label("- ").content(this.record.YEAR2).build());
// }

fieldsArray.push(new ViewFieldBuilder().label("; ").content(this.record.VOLG[0]?.VOL).build());
if(this.record.VOLG?.length > 1) {
Expand Down
2 changes: 1 addition & 1 deletion cloudapp/src/app/catalog/results-types/results-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export abstract class IDisplayLines {
// The most detailed PUBDT is superior to the YEAR1 field
// The PUBDT is separated by dots (e.g. year.month.day)
let record = this.fullRecord.getSummaryView();
let mostDetailedData = !this.isEmpty(record.YEAR1)? record.YEAR1 : "";
let mostDetailedData = !this.isEmpty( record.YEAR1) && record.YEAR1.match(/^[0-9]+$/)? record.YEAR1 :"";
if(!this.isEmpty(record.PUB)) {
record.PUB.forEach(pub => {
if(!this.isEmpty(pub.PUBDT) && (pub.PUBDT.split(/\./g)?.length >= mostDetailedData.split(/\./g)?.length)) {
Expand Down

0 comments on commit d5ce037

Please sign in to comment.