This will get me current time in seconds:
let currentTimeInSeconds = new Date().getTime() / 1000;
I have an array with the object expirationDate
, it returns that information in seconds. I can get the bills that expired, however, I'd like to filter out the bills that are expiring today.
this.ExpiringTodayBills = this.UnpaidDuebills.filter(bills => bills.paid === false && bills.expirationDate = currentTimeInSeconds);
The above code doesn't work because current time changes constantly due to hours, minute, seconds and milliseconds.
How would I be able to compare if expirationDate = today, regardless of the time?
Edit: This is an example of a bill
name: Test bill
paid: false
expirationDate: 1535598000 (which means August 30, 2018 3:00:00 AM)
amount: 231.33