File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -119,13 +119,13 @@ var plugin = {},
119
119
var periodsToFetch = [ ] ,
120
120
utcMoment = common . moment . utc ( ) ;
121
121
122
- utcMoment . subtract ( 2 , " months" ) ;
123
- periodsToFetch . push ( utcMoment . format ( "YYYY" ) + ":" + utcMoment . format ( "M" ) ) ;
124
- utcMoment . add ( 2 , "months" ) ;
125
-
126
- utcMoment . subtract ( 1 , "months" ) ;
127
- periodsToFetch . push ( utcMoment . format ( "YYYY" ) + ":" + utcMoment . format ( "M" ) ) ;
128
- utcMoment . add ( 1 , "months" ) ;
122
+ var monthBack = parseInt ( params . qstring . months ) || 3 ;
123
+
124
+ for ( var i = monthBack - 1 ; i > 0 ; i -- ) {
125
+ utcMoment . subtract ( i , "months" ) ;
126
+ periodsToFetch . push ( utcMoment . format ( "YYYY" ) + ":" + utcMoment . format ( "M" ) ) ;
127
+ utcMoment . add ( i , "months" ) ;
128
+ }
129
129
130
130
periodsToFetch . push ( utcMoment . format ( "YYYY" ) + ":" + utcMoment . format ( "M" ) ) ;
131
131
You can’t perform that action at this time.
0 commit comments