I have an array of hashes with 2 keys that have timestampvalues (YYYY/MM/DD/HH/MM/SS) : start_date and end_date.
Array_initial = [
{ :started_at => 20201105143200, :ended_at => 20201105143900 },
{ :started_at => 20201105142900, :ended_at => 20201105143300 },
{ :started_at => 20201105142800, :ended_at => 20201105143000 },
]
I want to convert this array of hashes into an array of arrays but sorted by comparing both started_at and ended_at timestamps. So the result would be this:
Array_final = [
[:started_at, 20201105142800],
[:started_at, 20201105142900],
[:ended_at, 20201105143000],
[:started_at, 20201105143200],
[:ended_at, 20201105143300],
[:ended_at, 20201105143900]
]
Can't figure out how to do that...