this code already gets the days until x date but it keeps counting when x date reaches the same date, how can I zero it out to stop counting?
const counters = this.state.counters.map((counters, i) => {
let untildate = counters.date
let diffDays1=(function(){
let oneDay = 24*60*60*1000 // hours*minutes*seconds*milliseconds
let secondDate = new Date(untildate);
let firstDate = new Date();
return (`${Math.round(Math.abs((firstDate.getTime() - secondDate.getTime())/(oneDay)))} Days`)
})();
If the input date is 2019-04-05T20:00:00.782Z the out put should be 0