Hi,
I have two fields of date in this format yyyymm(from date and to date)
I have the following code:
This gives me dynamic year(upto current year)..
But as soon as I add the commented code
It fails...
I need date as follows:
If year is 2012 & month is june then list should show 201206
Now current month is june so it should show...201306,2 01305,201304,.. .....,201212,20 1211,201210,... ...& so on..
Can any one help?
I have two fields of date in this format yyyymm(from date and to date)
I have the following code:
Code:
function populateYearSelect()
{
d = new Date();
curr_year = d.getFullYear();
// curr_month = d.getMonth();
for(i = 0; i < 2; i++)
{
document.getElementById('year').options[i] = new Option(curr_year-i,curr_year-i);
// document.month.option[curr_month].selected=true;
}
}
But as soon as I add the commented code
Code:
// curr_month = d.getMonth(); // document.month.option[curr_month].selected=true;
I need date as follows:
If year is 2012 & month is june then list should show 201206
Now current month is june so it should show...201306,2 01305,201304,.. .....,201212,20 1211,201210,... ...& so on..
Can any one help?
Comment