Hello every i have date field of type string with iso format like this:
const date = \"2017-06-10T16:08:00: i want somehow to edit the string in the following format like th
function formatDate(userDate) {
// format from M/D/YYYY to YYYYMMDD
return (new Date(userDate).toJSON().slice(0,10).split('-').reverse().join('-'));
}
console.log(formatDate("2017-06-10T16:08:00"));