My goal is to change the color of text to green when the expiration date has not been reached yet. If the expiration date has passed, then the text should be red.
.curentDate {
color: rgb(54, 168, 54)
}
.expirationDate{
color: red;
}
<div class="form-group col">
<h5 for="maintenancePackage">Maintenance Package</h5>
<p class="{{ setexpirationDate(ticket) }}">{{ getMaPackage(ticket) }}</p>
</div>
app.ts
setexpirationDate(ticket) {
let color = ''
const endDate = moment(ticket.site.maEndDate.seconds * 1000).format('L');
const currentDate = new Date()
const currentDateFormat = moment(currentDate).format('L');
if (endDate < currentDateFormat) {
color = 'curentDate'
} else {
color = 'expirationDate'
}
}