If i have this markup:
item 1
item 1>
The custom function suggested in Joseph's answer (the currently accepted solution) should return a numeric value, not a boolean. See This other question where this issue has already been raised showing that this function will not work in IE.
The "dates.compare(a,b)" function defined here looks like a better fit for use in jQuery's sort method.