I am using an input field to get a date which is stored in a ISO format like "yyyy-mm-dd".
I want to convert it to a human-readable format to display in the HTML, so 2000-05-03 will look something like May 3, 2000.
How can I transform it from ISO format to American format?
You can achieve it using the below code:
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var today = new Date();
console.log(today.toLocaleDateString("en-US", options));
Check here for more info - Another Date format related question
Yes, you can use toLocateDateString() for it. And with the options format the date.
For your example it will be like this:
const date = new Date("2000-05-03");
date.toLocaleString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })
console.log(date);
Will print May 3, 2000