JSFiddle - React, Tailwind, and code Playground

JavaScript

//"5/2/2017 12:00 am","5/3/2017 11:59 pm"],
var date =  new Date();
var day = date.getDay();
var month = date.getMonth() + 1;
var year = date.getFullYear();

var yesterday = new Date(date.getTime());
yesterday.setDate(date.getDate() - 3);
var dayBefore = yesterday.getDay();
var MonthBefore = yesterday.getMonth() + 1;


console.log(date)
console.log(yesterday)
console.log(month + '/' + day + '/' + year + " 11:59 pm")
console.log(MonthBefore + '/' + dayBefore + '/' + year + " 12:00 am")

console.log(yesterday.getDay());