I have a query regarding to find out which is day (in given list) is nearest day from today.
For example
day_list is Mon, Tue, Fri, Sat
and today is Wed
Now If we calculate days on paper,
Wed to Mon = 5 days
Wed to Tue = 6 days
Wed to Fri = 2 days
Wed to Sat = 3 days
So answer will be Fri
.
But in code, how can I implement this logic? Or is there any other way to optimize its process (regarding if_else)?