Hi All,
I need to convert the month in number to read month in Words.
I made a javascript function to convert that like below :
function convert(mycontrolclientID)
{
var ldtDate=mycontrol.value;
var month=new Array();
var lstrDay,lstrMonth,lstrYear,lstrMonthinword=1,lstrDate;
month = ["",'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'];
lstrDay = ldtDate.substr(0,2);
lstrMonth = ldtDate.substr(3,2);
lstrYear = ldtDate.substr(6,4);
lstrMonthinword = month[lstrMonth];
lstrDate = lstrDay + "-" + lstrMonthinword + "-" + lstrYear;
return lstrDate;
}
All Months are properly converting to Words except '08' and '09';
i.e 08-08-2012 returning 08-undefined-2012 or 08---2012;
But 03-11-2012 is converting correctly to 03-NOV-2012;
Any Tips/Suggestions to fix this :)