0 Replies Latest reply on Oct 5, 2009 5:39 AM by tguy895

    A Little Help Needed (Date Class)

    tguy895

      I have the following three classes:

       

      Solution.as

      package
      {
         public class Solution implements IDateCreator
           {
               public function Solution()
      {
      }

      public function releaseToLastDate(d:Date):Date
      {
          ////????????//////
      }
      }

      ----------------------------------------------------------------------------------------- -------------------
      IDateCreator.as

      package
      {
         public interface IDateCreator
            {
               function releaseToLastDate(d:Date):Date;
            }
      }

      ----------------------------------------------------------------------------------------- ---------------------------
      DateTest.as

      package {
          import flash.display.Sprite
         {
         private var a1:Date  = new Date (2009, 10, 6);
         private var  a2:Date = new Date(2010 , 12);
      private var b1:Date  = new Date (1987, 11, 6);
      private var b2:Date  = new Date (1988, 12);

      private var solution:Solution;


      public function DateTest()
      {
      solution = new Solution();
      var yearTestPassed:Boolean;
      var monthTestPassed:Boolean;


      yearTestPassed = (solution.releaseToLastDate(a1).fullYearUTC = a2.fullYearUTC) && (solution.releaseToLastDate(b1).fullYearUTC == b2.fullYearUTC);

      monthTestPassed = (solution.releaseToLastDate(a1).fullMonthUTC = a2.fullMonthUTC) && (solution.releaseToLastDate(b1).fullMonthUTC == b2.fullMonthUTC);

      trace(“Year Test Passed:” + yearTestPassed);
      trace(“Month Test Passed:” + monthTestPassed);

       

      I need to figure out what goes in the releeaseToLastDate function in the Solution class order for both boolean expressions to be true. These classes are what i have written so far, and i just need assistance on what needs to go in place of those question marks.