How to show yesterday\'s date in my textbox the yesterday\'s date and at the same time, the today\'s date in ?
I have this home.php where I show the date yesterday(
Get yesterday date in javascript
You have to run code and check it output
var today = new Date();
var yesterday = new Date(today);
yesterday.setDate(today.getDate() - 1);
console.log("Original Date : ",yesterday);
const monthNames = [
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
];
var month = today.getMonth() + 1
yesterday = yesterday.getDate() + ' ' + monthNames[month] + ' ' + yesterday.getFullYear()
console.log("Modify Date : ",yesterday);