Find all nearest date from list of date in kotlin
I have current date and I have of list which is coming from server. I want to find all first nearest data.
"Results": [
{
"date": "May 9, 2020 8
0903 PM",
"id": 1
},
{
"date": "Apr 14, 2020 8
0903 PM",
"id": 2
},
{
"date": "Mar 15, 2020 8
0903 PM",
"id": 3
},
{
"date": "May 9, 2020 8
1903 PM",
"id": 4
}
],
Today date is Wed...