Oct-12-2023, 02:37 PM
(This post was last modified: Oct-12-2023, 02:37 PM by jacksfrustration.)
(Oct-12-2023, 01:39 PM)buran Wrote:from calendar import Calendar from datetime import date year, month, *_ = date.today().timetuple() cal = Calendar() dates = [dt.strftime('%a %d %B %Y') for dt in cal.itermonthdates(year, month) if dt.month == month] print(dates)
Output:['Sun 01 October 2023', 'Mon 02 October 2023', 'Tue 03 October 2023', 'Wed 04 October 2023', 'Thu 05 October 2023', 'Fri 06 October 2023', 'Sat 07 October 2023', 'Sun 08 October 2023', 'Mon 09 October 2023', 'Tue 10 October 2023', 'Wed 11 October 2023', 'Thu 12 October 2023', 'Fri 13 October 2023', 'Sat 14 October 2023', 'Sun 15 October 2023', 'Mon 16 October 2023', 'Tue 17 October 2023', 'Wed 18 October 2023', 'Thu 19 October 2023', 'Fri 20 October 2023', 'Sat 21 October 2023', 'Sun 22 October 2023', 'Mon 23 October 2023', 'Tue 24 October 2023', 'Wed 25 October 2023', 'Thu 26 October 2023', 'Fri 27 October 2023', 'Sat 28 October 2023', 'Sun 29 October 2023', 'Mon 30 October 2023', 'Tue 31 October 2023']
thats closer to what i need. Is there a way to automatically slice the list you provided me with in order to display the past 5 and upcoming 5 days? Cause i tried using the list you provided me in the optionmenu but isntead of the menu opening in vertical fashion it opened in horizontal orientation and i could not choose just one element for some weird reason