Trying to get Friday's date of current week from current date (today's date) using JQuery.
Something like below:(this doesn't work)
var curr = new Date;
var fridayDate = new Date(curr.setDate(curr.getDate() - curr.getDay()+4));
new Date().getDay(); //0=Sun, 1=Mon, ..., 6=Sat
This is how to get Weekday.
friday is 5. so, try this one
var curr; curr = new Date(); var fridayDate; fridayDate = new Date(); var friday; friday = 5 - curr.getDay(); fridayDate.setDate(fridayDate.getDate()+friday); console.log(curr); console.log(fridayDate);