3 Replies Latest reply on Jul 24, 2009 9:44 AM by Flex harUI

    needed an example of the compareFunction for Date-sorting

    Vanden_B Level 1

      Hi All,

       

      I just need an example of the compareFunction (dateCompareFunc) on how to sort an ArrayCollection on a date (StartDate is of Date-type).

       

      var sort:Sort = new Sort();
      var sortField:SortField = new SortField("StartDate");
      sortField.compareFunction = dateCompareFunc;
      sort.fields = [ sortField ];

       

      dateSortedAC.sort = oSort;
      dateSortedAC.refresh();

       

      Can anybody give an example?

       

      Thnx!!