Actionscript Date Extension Class
17.09.05 @ 2:04 amOver 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
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.actionscript, class, date, day, flash, month, object oriented actionscript year


February 14th, 2006 at 7:04 pm
$0.00 in Comment Love for September
The download link is broken!
Just thought I’d let you know! But I found your file on actionscript.org too!
February 15th, 2006 at 10:11 am
Fixed. Thanks for the find!
August 29th, 2006 at 4:01 pm
$5.00 in Comment Love for September
[…] http://www.somerandomdude.net/blog/flash/actionscript-date-extension-class/ […]
September 22nd, 2006 at 8:28 pm
$0.00 in Comment Love for September
I’m having trouble getting the “daysinMonth” function to work. It keeps coming up with undefined. Can you give me some direction?
April 11th, 2007 at 8:37 am
$0.00 in Comment Love for September
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”);
April 11th, 2007 at 9:11 am
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!