const formatYmd = date => date.toISOString().slice(0, 10); formatYmd(new Date());
const yourDate = new Date() yourDate.toISOString().split('T')[0]