Can anybody shed some light on getDay() in Javascript please.
Here datepicker is textbox where it gets value from Jquery DatePicker Control
var CallbackDateNumber;
// check for the value in Date of callback control
if(("#datepicker")!="")
{
CallbackDateNumber = new Date($("#datepicker").val()).getDay();
}
else
{
CallbackDateNumber=new Date().getDay();
}
For January Date its gives 0,1…6- From Sunday to Saturday.
But the same order is not preserved in Month Febraury.
Any reason why this happening?
Your dates need to be in
MM/DD/YYYYformat. It’s parsing 05/02/2012 as May 2, 2012 and 06/02/2012 as June 2, 2012.