I'd suggest placing the burden of making sure the data is sorted on to the provider of the data.  If you don't want to trust the server, that's fine, you'd then want the piece of javascript that gets the data from the server to sort it.  Mainly, there's no reason to push the extra sorting logic down, at the time someone asks for "timeSeries.data" they'll want to work with sorted data.