I have an ion-card that displays information read from firebase. 1 such piece of information is a date. If the date is equal to today then I want to do some styling.
In my html ion-card-content tag I have the following code
<ion-card-content [ngClass]="isMatchDateToday(match?.date.seconds * 1000)">
I want to call a function that passes in the date as a parameter and compares it today's date.
isMatchDateToday(date: Date){
}
I'm really not sure how to compare the dates. I've used today = date.now() and tried to compare it with my date however when console.log the values they have a long numerical values of different length.
I'd expect something like this (pesudocode)
isMatchDateToday(date: Date){
var today = Date.now();
if (date == today)
{
return "css-class-name";
}
}