Given dayNumber is from 0 - 6 representing Monday - Sunday respectively.
dayNumber
0
6
Monday
Sunday
Can the Date /
Date
This will add a getDayOfWeek() function as a prototype to the JavaScript Date class.
Date.prototype.getDayOfWeek = function(){ return ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][ this.getDay() ]; };