I have this code:
var str = $("#datepicker").datepicker("getDate");
var datestr = str.toString().split(" ");
switch(datestr[1]) {
case "Jan":
var datestrmon = "Яну";
break;
case "Feb":
var datestrmon = "Фев";
break;
case "Mar":
var datestrmon = "Мар";
break;
case "Apr":
var datestrmon = "Апр";
break;
case "May":
var datestrmon = "Май";
break;
case "Jun":
var datestrmon = "Юни";
break;
case "July":
var datestrmon = "Юли";
break;
case "Aug":
var datestrmon = "Авг";
break;
case "Sep":
var datestrmon = "Сеп";
break;
case "Oct":
var datestrmon = "Окт";
break;
case "Nov":
var datestrmon = "Ное";
break;
case "Dec":
var datestrmon = "Дек";
break;
default:
datestr[1];
}
alert(datestrmon);
I expect when the browser is alerting me datestrmon to alert "Юли" ,but it alerts me "undefined".Why?