function getQuarter(d) { var enterOnce = true; d = d || new Date(); var m = Math.floor(d.getMonth() / 3) + 1; // gives you the current quarter. return m > 4 ? m - 5 : m; }
function FillDropdownList() { var firstListItem = "<option value = '0'>select quarter</option>"; var currentQuarter = getQuarter(new Date()); var listOptions = ""; for (var i = currentQuarter; i; i--) { listOptions += "<option value = '" + i + "'>Q" + i + " " + (new Date).getFullYear() + " list" + "</option>"; } listOptions = firstListItem + listOptions; // to have short list of options which corresponds to the country // from the row we have to change temporary the column property $("select#drpQuarter").empty(); setTimeout(function() { $("select#drpQuarter").html(listOptions); }, 200); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)