JSFiddle - React, Tailwind, and code Playground

HTML

<div>Foo bar</div>

JavaScript

Date.prototype.DaysBetween = function(){  
            var intMilDay = 24 * 60 * 60 * 1000;  
            var intMilDif = arguments[0] - this;  
            var intDays = Math.floor(intMilDif/intMilDay);  
            return intDays;  
        }  
        var d1 = new Date('12/05/2012');  
        var d2 = new Date('12/09/2012');  
        alert("you only have" + d1.DaysBetween(d2));