The day of the week for the specified date
getWeekDay(date) function returns the short form of the day of the week for given date(ex: ‘Sun’, ‘Mon’, ‘Tue’…, ‘Sat’).
function getWeekDay(date) {
var days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
return days[ date.getDay() ]
}
var date = new Date(2015, 0, 1) // 1 Jan 2015
alert( getWeekDay(date) ) // 'Thu'