Do that using a loop that iterates 12 times. (Not tested code)
//Given the start date, add a row for 12 months from that day
function SaveAddFiscalPeriod( startDate ) {
//Convert to a date type - assuming first of month otherwise you'll need to adjust the day to 1
var start = Date.parse(startDate);
//Note that setMonth modifies `start` so it jumps 1 month each time through the loop
for (let index = 0; index < 12; ++index) {
gvDT.row.add([ ID, start, new Date(start.setMonth(date.getMonth()+1)) ]);
}
}
In your current code you're inserting a row that has an ID, start and end date. I don't know how that maps to what you're asking so I'm assuming the start date is the beginning of the month and the end date is the end of the month. I'm not sure what you're $(EndDate) element points to but you said given a start date add a row for each month so end date is sort of implied.