Fork me on GitHub
#beginners
<
2016-09-30
>
mikepjb21:09:36

With a list of vectors like this - (["2016-09-12 08:00:38" "A" "105.87454"] ["2016-09-12 08:01:01" "A" "106.32525"] ["2016-09-12 08:02:16" "A" “106.55725”])

mikepjb21:09:21

how would you filter the list to return the vector with the latest date?

mikepjb21:09:13

since the time format is iso 8601 I was looking to filter them as strings

jswart21:09:28

sort them by date, then take the first one?

jswart21:09:08

checkout sort-by, something like (sort-by first compare-by-date list-of-things)

jswart21:09:00

where compare-by-date coerces the strings to dates and then does a date comparison to determine which is more recent

mikepjb21:09:21

perfect, thanks @jswart

mikepjb21:09:42

I had been fiddling around with min-key/max-key