Am looking for something where I could get a array of next three months in number from the current month , i have tried to get the month in string but looking for something like eg : current month is 11 (ie) November so it should return 12,1,2 as next three months , any links would be great. TIA

Given you want the next three months I see two quick solutions.

1. Math. In psuedo code:
cm = 11 'current month
array = cm +1;
array = array+1;
array = array+2;
for i = 1 to 3; if array[i]>12 then array[i]--12;

2. Another method but with some array copy.
marray[]= 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3
arraycopy(array (from), marray[cm], 3 locations)

My answer here is messy and in psuedocode. You can tailor it to fit or create your own solution.

In JS months numbered from 0 to 11. Actually 11 is december. You can write simple function

``````function addMonths(d,n){
var dt=new Date(d.getTime());
dt.setMonth(dt.getMonth()+n);
return dt;
}``````

and then e.g.

``````var d=new Date(); // current date
``````var n1=d1.getMonth()+1;
``````function getNext3Months() {