private function dateSort():void{

                var array1:ArrayCollection = new ArrayCollection();
                var array2:ArrayCollection = new ArrayCollection();

                array1.addItem(new Date("2009", 1, 5));
                array1.addItem(new Date("2009", 1, 1));
                array1.addItem(new Date("2009", 1, 3));
                array1.addItem(new Date("2009", 1, 2));
                array1.addItem(new Date("2009", 1, 4));

                array2.addItem(new Date("2009", 1, 6));
                array2.addItem(new Date("2009", 1, 9));
                array2.addItem(new Date("2009", 1, 7));
                array2.addItem(new Date("2009", 1, 10));
                array2.addItem(new Date("2009", 1, 8));

                array1.addAll(array2);

                 var sortField:SortField = new SortField();
                sortField.compareFunction = dateCompareFunc;

                var sort:Sort = new Sort();
                sort.fields = [sortField];
                array1.sort = sort;
                array1.refresh();
            }

            private function dateCompareFunc(dt1:Date, dt2:Date):int {
                return ObjectUtil.dateCompare(dt1, dt2);
            }






On Thu, Nov 12, 2009 at 7:47 AM, asea19 <[email protected]> wrote:

>
>
> I have two ArrayCollections of scattered dates coming in for the past 5
> years. I need to take these two lists and create a new object with the dates
> from both combined into a list with all the dates in order. Any ideas?
>
>  
>

Reply via email to