function getDayOfWeek (date) {
var dayOfWeek;
date = date.match(/(\d{2})\.(\d{2})\.(\d{4})/);
switch (new Date(date[3], date[2] - 1, date[1]).getDay()) {
case 0:
dayOfWeek = 'Воскресенье';
break;
case 1:
dayOfWeek = 'Понедельник';
break;
case 2:
dayOfWeek = 'Вторник';
break;
case 3:
dayOfWeek = 'Среда';
break;
case 4:
dayOfWeek = 'Четверг';
break;
case 5:
dayOfWeek = 'Пятница';
break;
case 6:
dayOfWeek = 'Суббота';
break;
}
alert(dayOfWeek);
}
getDayOfWeek(prompt('Введите дату в формате dd.mm.yyyy'));