Ticket Fixing: #111, #110, #108 (SortBy)

This commit is contained in:
2024-09-09 17:35:08 +02:00
parent 9ecc0c2429
commit 06d83a478d
23 changed files with 308 additions and 70 deletions

View File

@@ -8,9 +8,14 @@
<img src="assets/images/placeholder_properties.jpg" alt="Image" class="w-full h-48 object-cover" />
}
<div class="p-4 flex flex-col flex-grow">
<div class="flex items-center justify-between mb-2">
<span [class]="selectOptions.getTextColorTypeOfCommercial(listing.type)" class="text-sm font-semibold"
><i [class]="selectOptions.getIconAndTextColorTypeOfCommercials(listing.type)" class="mr-1"></i> {{ selectOptions.getCommercialProperty(listing.type) }}</span
>
<div class="flex items-center justify-between my-2">
<span class="bg-gray-200 text-gray-700 text-xs font-semibold px-2 py-1 rounded">{{ selectOptions.getState(listing.location.state) }}</span>
<span class="text-gray-600 text-sm"><i [class]="selectOptions.getIconTypeOfCommercials(listing.type)" class="mr-1"></i> {{ selectOptions.getCommercialProperty(listing.type) }}</span>
<p class="text-sm text-gray-600 mb-4">
<strong>{{ getDaysListed(listing) }} days listed</strong>
</p>
</div>
<h3 class="text-lg font-semibold mb-2">
{{ listing.title }}

View File

@@ -2,6 +2,7 @@ import { CommonModule } from '@angular/common';
import { ChangeDetectorRef, Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import dayjs from 'dayjs';
import { CommercialPropertyListing } from '../../../../../../bizmatch-server/src/models/db.model';
import { CommercialPropertyListingCriteria, LISTINGS_PER_PAGE, ResponseCommercialPropertyListingArray } from '../../../../../../bizmatch-server/src/models/main.model';
import { environment } from '../../../../environments/environment';
@@ -81,4 +82,7 @@ export class CommercialPropertyListingsComponent {
getTS() {
return new Date().getTime();
}
getDaysListed(listing: CommercialPropertyListing) {
return dayjs().diff(listing.created, 'day');
}
}