JSFiddle - React, Tailwind, and code Playground
JavaScript
const from = new Date(2020, 0, 20);
const to = new Date(2020, 1, 1).setHours(24);
const millisecondsToDays = ms => ms / (24 * 60 * 60 * 1000);
const totalDays = millisecondsToDays(to - from);
console.error('totalDays', totalDays);