How to sort a random DateTime array from oldest to newest?

thank you. I searched for bubble sorting and was trying to apply it, and came up with this:

but it doesn’t really do anything other than swapping two entries (maybe) and returning a lot of errors.

let me try your suggestion real quick