ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

How can loop for append year in select box

when i create a report in filter i need a select box which have show last 10 year but how can i show i cant understood ,
if anyone help me about that its helpfull to me

frappe.query_reports[“A1”] = {
“filters”: [
{
“fieldname”:“employeeId”,
“label”: __(“Employee”),
“fieldtype”: “MultiSelectList”,
“options”: “Employee”,
get_data: function(txt) {
return frappe.db.get_link_options(“Employee”, txt);
},
},
{
“fieldname”:“month”,
“label”: __(“Month”),
“fieldtype”: “Select”,
“options”: [“Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”,“July”,“Aug”,“Sep”,“Oct”,“Nov”,“Dec”],
“default”: “Jan”
},
{
“fieldname”:“year”,
“label”: __(“Year”),
“fieldtype”: “Select”,
“options”: [“2021”, “2020”, “2019”, “2018”, “2017”, “2016”,“2015”,“2014”,“2013”,“2012”,“2011”,“2010”],
“default”: ‘2021’
}
]
};

basicaly i want this “options”: [“2021”, “2020”, “2019”, “2018”, “2017”, “2016”,“2015”,“2014”,“2013”,“2012”,“2011”,“2010”],
“default”: ‘2021’
handle it dynamicaly

Solved