dateToNumber(date) {
        // Clone the date and strip the time off.
        const dateOnly = new Date(date.getTime());
        dateOnly.setHours(0, 0, 0, 0);

        // Set the number to be the number of days between the date and the base date.
        // We need to round as daylight savings will cause fractional days, which we don't want.
        let number = Math.round((dateOnly - dateBase) / millisecondsInDay);
        
        // Add the true fractional days from just the milliseconds left in the current day.
        number += (date - dateOnly) / millisecondsInDay;

        // Adjust for the "bug" in Excel that treats 1900 as a leap year.
        if (date > incorrectLeapDate) number += 1;

        return number;
    }
Convert a date to a number for Excel.
@param {Date} date - The date.
@returns {number} The number.