I'm trying to get the first day of the week by date,
This code
var firstDayOfWeek = new Date(now.setDate(now.getDate() - now.getDay()+1));
returns
Mon Oct 29 2018 17:50:02 GMT+0000 (Greenwich Mean Time)
How do I just get the date in the following format.
YYYY-MM-DD