My apologies if this is posted elsewhere in the forum, but I went through several articles without luck.
I am attempting to populate a drop-down component with a list of dates starting with current day and each date going back 7 days. When the end-user selects a date, the plan is for the date to be passed to the SQL query that is populating a table on that page, so only the records from the selected date are provided.
As this drop-down will be needed on several windows, I have created a script called DateSelection in the project that pulls the desired date range (code below):
date = datetime.datetime.today()
date_range = 7
selection = [date - datetime.timedelta(days=x) for x in range(date_range)]
for date in selection:
I am struggling with getting this bound to the drop-down list button on the window, so when the end-user clicks on the arrow, they are presented with the dates and can select one. I have tried a few things without much success.
Has anyone else ran into something similar? What am I missing?