[Library | develop]: searchProjects.service.ts: Added more checks if startdate and enddate properties exist in the response | entity-metadata.component.ts: Added "From" or "Until" before startYear and endYear respectively when only one of them exists in data.
This commit is contained in:
parent
6958a8ef9b
commit
adae1f0749
|
@ -60,10 +60,10 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
|||
<span>{{year}}</span>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="startYear && !endYear">
|
||||
<span>{{startYear}}</span>
|
||||
<span>From {{startYear}}</span>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="!startYear && endYear">
|
||||
<span>{{endYear}}</span>
|
||||
<span>Until {{endYear}}</span>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="startYear && endYear">
|
||||
<ng-container>
|
||||
|
|
|
@ -248,10 +248,10 @@ export class SearchProjectsService {
|
|||
}
|
||||
}
|
||||
}
|
||||
if(resData.hasOwnProperty("startdate")) {
|
||||
if(resData.hasOwnProperty("startdate") && resData['startdate']) {
|
||||
result.startYear = resData.startdate.split('-')[0];
|
||||
}
|
||||
if(resData.hasOwnProperty("enddate")) {
|
||||
if(resData.hasOwnProperty("enddate") && resData['enddate']) {
|
||||
result.endYear = resData.enddate.split('-')[0];
|
||||
}
|
||||
// Measure
|
||||
|
|
Loading…
Reference in New Issue