3 Replies Latest reply on Aug 21, 2006 1:24 PM by The_350Z

    Questions about Date in flash

    The_350Z Level 1
      Hi everyone,

      I'm doing an experimental Blog now and having some difficulties about Date in Flash.

      What I'm trying to do is to seperate each months into weeks.
      So let's say I want to display my blog in August. Since August has 5 weeks, I want to display all entries in 5 different tables. Each table represents week. So the first table will only show 6 entries, because the first week of August begins tuesday (aug 1) and ends Sunday (Aug 6).

      The second table will display 7 entries and so forth.

      Is this possible?

      thank you
        • 1. Re: Questions about Date in flash
          Rothrock Level 5
          Yes it is doable. Check the help filed for the Date class. There you will find the getDay() method. This returns an integer representing the day of the week a given date will fall upon. It starts 0 for Sunday, 1 for Monday, and so on.

          So to figure out which day August 1, 2006 was you would do this:

          myDate=new Date(2006,7,1)//Remember months start at 0 for Jan
          trace(startDay)//Should be 2 for Tuesday

          Also a nice trick is this:

          myDate=new Date(2006,7,0);

          That gives you the zeroth day for August which is really the last day of July. I'm sure you will find a million uses for that.
          • 2. Questions about Date in flash
            injpix Level 3
            The code below will find the first day and last day of the month. It has trace statements that will output a message on where to create code for these tables and entry fields that you plan to have. I don’t know if you need to create these tables/entries for the whole year or not, if so then you need to change the month parameter for the Date object constructor.
            • 3. Re: Questions about Date in flash
              The_350Z Level 1
              Oh thanks alot guys!!
              I'm sorry for such a late reply, I was away for a fewdays without a computer.

              But thanks alot, I really appreciate it!!!