# Sort by date!

**URL:** <https://forum.kirupa.com/t/sort-by-date/245272>\
**Category:** flash\
**Created:** [November 28, 2007, 6:26am UTC](https://forum.kirupa.com/t/sort-by-date/245272 "2007-11-28T06:26:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bzouchir](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bzouchir/32/2088_2.png) [@bzouchir](https://forum.kirupa.com/u/bzouchir)\
**Post date:** [November 28, 2007, 6:26am UTC](https://forum.kirupa.com/t/sort-by-date/245272/1 "2007-11-28T06:26:52Z")

</div>

hi guys,

i have this array that i need to sort by name or date.

Sorting by name worked out pretty well of course, but the sorting by date is bit too tricky :S

var test:Array = [{name:“name1”,date:“10-01-2007”},{name:“name2”,date:“01-02-2007”}];

if i try to sort the date, since it’s a string it doesn’t sort properly.  
also tried

test.sortOn(“date”,Array.NUMERIC);

but of course it sorts left to right 10 vs 01 and then it hits “-”  
and that’s about it, which is expected.

so please help me finding a way to sort this out :S

some sample or guidance, would probably need to start sorting in this order somehow  
year–\>month–\>day

any help or guidance is appreciated.

thx
