I got an array with date objects. And I need to display the different days between today from each object. Currently my Code looks like this, its just for one date "[0]", but it should also works for object arrays "sortedOpenBill". How could I handle this?
const diffDaysinMS = new Date(sortedOpenBill[0]?.deadline).getTime() - new Date().getTime();
const diffDays = Math.ceil(diffDaysinMS / (1000 * 3600 * 24));