1let today = new Date().toISOString().slice(0, 10)
2
3const startDate = '2021-04-15';
4const endDate = today;
5
6const diffInMs = new Date(endDate) - new Date(startDate)
7const diffInDays = diffInMs / (1000 * 60 * 60 * 24);
8
9
10alert( diffInDays );