This is my data:
k = {'10-06-2021': [1,2,3], '09-06-2021': [2,3,4], '08-06-2021': [5,6,7], '01-06-2021': [8,9,10], '31-05-2021': [11,12,13], '11-06-2021': [14,15,16], '07-06-2021': [17,18,19]}
print(k)
p = sorted(k.items())
print(p)
I want to sorted according to date key and my date format is "dd-mm-yy". when printing data is not comming in order.The issue is sorted function compares data in "yy-mm-dd" format.
I want data to be sorted in ascending date key format. And using sorted() only.
If i write "10-06-2021" as "2021-06-10" result is perfect but this k value is going to db so i don't want to change it.