I am getting input as start_date and end_date, now I want to fetch data based on months between start_date and end_date. How that can be done in python/django?
I am getting date in format as -
start_date = '2021-5-5' #YYYY-MM-DD format
end_date = '2021-6-5'
Required results -
result = [
{
'month' : 'may',
'data' : data_for_may # from date 5th of may to 31st of may
},
{
'month' : 'june',
'data' : data_for_june # from date 1st of june to 5th of june
}
]