Hey there, it looks like this is your first time here. May I suggest subscribing to this blog and checking out these articles.

SOME RANDOM DUDE

Actionscript Date Extension Class

17.09.05 @ 2:04 am

Over the past couple weekends, I’ve finally had the chance to finish up a class I started quite a while ago. I had made an extension to Flash’s Date class but there were a ton of things that I wanted to change/add to the class when I had the chance.

I finally was able to get it to a nice stopping point and I felt it was a good time to set the code free into the real world. While this class isn’t anything groundbreaking. It has a lot of really nice methods that will make date-based Flash applications a lot easier.

Here’s a list of the methods in this class, I think the names are fairly self-explanatory.

  • getDayOfWeek
  • isSunday
  • isMonday
  • isTuesday
  • isWednesday
  • isThursday
  • isFriday
  • isSaturday
  • isWeekend
  • setDaysInMonth
  • get daysInMonth
  • getDaysLeftInMonth
  • get daysInYear
  • monthStartDate
  • monthEndDate
  • setWeeksInMonth
  • getWeeksInMonth
  • get daysInWeeks
  • get daysInWeek
  • getDay
  • getDayName
  • getMonthName

Download XDate Class

I know XDate is a slightly cheesy name but it actually has a fairly logical reason. It was based off the naming convention I came up with that all extention classes start with an ‘X’. Please feel free to send me feedback., , , , , ,

Liked This Post?

Well then, post the article to del.icio.us and subscribe to Some Random Dude's RSS Feed.

Show some comment love.

Total Donations for November:

$11.00

Want to help a good cause? Want to get this number higher? Learn how.

8 Responses to “Actionscript Date Extension Class”

  1. Gravatar
    $0.00 in Comment Love for November

    The download link is broken!

    Just thought I’d let you know! But I found your file on actionscript.org too!


  2. Fixed. Thanks for the find!


  3. Gravatar
    $3.00 in Comment Love for November

  4. Gravatar
    $0.00 in Comment Love for November

    I’m having trouble getting the “daysinMonth” function to work. It keeps coming up with undefined. Can you give me some direction?


  5. Gravatar
    Domenico Zimbalero

    $0.00 in Comment Love for November

    In Spanish it is not necessary to put articles before of the day name when formating dates.

    private var dayNameSP:Array = new Array(”Domingo”, “Lunes”, “Martes”, “Miércoles”, “Jueves”, “Viernes”, “Sábado”);


  6. Domenico - Apologies for my ignorance. Thanks so much for filling me in - I will make the changes on this when I update it to AS3.

    Thanks again!


  7. Gravatar
    $0.00 in Comment Love for November

    I know this is OLD.. but is there any documentation of this class? examples of its use?..etc..etc


  8. […] finish porting a Date Extension Utility class from AS2 to AS3. I think it was originally based on this one. This should normally be straighforward. First snag, Date is final…grrr. Okay so I’ll wrap an […]


Leave a Reply

Additional Doodads

Subscribe to Some Random Dude

Related Entries:

Most Commented Pages