programming-examples/js/Date/Write a JavaScript function to get a full textual representation of the day of the week (Sunday through Saturday)..js

12 lines
312 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
Date.longDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
function long_Days(dt)
{
return Date.longDays[dt.getDay()];
}
dt = new Date();
console.log(long_Days(dt));
dt = new Date(2015, 10, 1);
console.log(long_Days(dt));