PROJECT UNDER MAINTENANCE
Hi all,
New Version of AS3 Date Chooser Released.
you can customize lot more things in it,
- Import Date Chooser class and event class
- Customize calendar icon dynamically.
- Dynamic Date Chooser construction
- Set calendar icon
- Set Week Start on Monday or Sunday
- Set Month Names
- Set Date Format
- Set system font
- Set embed font
- Add Date Chooser to stage
- Date Chooser Event
- everything id dynamic :) you can simply change anything from code.
import nid.utils.dateChooser.DateChooser; import nid.events.calendarEvent;
[Embed(source = "../asset/20x20_light_blue.png")]
private var icon:Class;
var dateChooser:DateChooser = new DateChooser();
dateChooser.icon = new icon();
dateChooser.WeekStart = "sunday";
dateChooser.Months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
dateChooser.dateFormat = "D/M/Y"; //D,M,Y all combinations are valid
dateChooser.font = "Tahoma";
[Embed(source = "../asset/tahoma.ttf", fontWeight= "normal", fontFamily = "Tahoma")]
protected static var Tahoma:Class;
[Embed(source = "../asset/tahomaBold.ttf", fontWeight= "bold", fontFamily = "Tahoma")]
protected static var TahomaBold:Class;
dateChooser.embedFonts = true;
dateChooser.font = "Tahoma";
addChild(dateChooser);
dateChooser.addEventListener(calendarEvent.CHANGE, getdate);
private function getdate(e:calendarEvent):void {
trace("Date:" + e.selectedDate);
}
i’m behind the documentation of this open source project
stay tuned and enjoy

DOWNLOAD SOURCE FILE: AS3-Date-Chooser-v4 (602)
DOWNLOAD SWC FILE : AS3-DateChooser-SWC file (384)
DOWNLOAD EXAMPLE FILE : AS3-DateChooser-example (448)
GOOGLE PROJECT PAGE : HERE












































#1 by matt on March 8, 2010 - 3:33 PM
This is fantastic.…a huge time saver!
#2 by jojo on March 29, 2010 - 8:10 PM
Works great. Thanks!
any hint on how to translate it?
#3 by nidinthb on March 29, 2010 - 8:15 PM
you mean language translate ?
#4 by Milfont on April 7, 2010 - 2:39 PM
Good work nid! Just one question, how i change the date textfield background?
#5 by nidinthb on April 7, 2010 - 9:18 PM
hi,
please download the updated source, one bug has fixed updated SWC will available soon
var dateChooser:DateChooser = new DateChooser();
dateChooser.dateField.fieldColor = 0xcccccc;
addChild(dateChooser);
#6 by nidinthb on April 7, 2010 - 9:19 PM
dfgdfgdfdgfgdgd
dfgdfgdfdgfgdgd
dfgdfgdfdgfgdgd
dfgdfgdfdgfgdgd
dfgdfgdfdgfgdgd
#7 by nidinthb on April 7, 2010 - 9:19 PM
dfgdfgdfdgfgdgd
dfgdfgdfdgfgdgd
dfgdfgdfdgfgdgd
dfgdfgdfdgfgdgd
dfgdfgdfdgfgdgd
#8 by Milfont on April 8, 2010 - 6:06 PM
How do I translate the months and the days names?
#9 by nidinthb on April 8, 2010 - 7:36 PM
i don’t understand what you mean by translate
#10 by Milfont on April 9, 2010 - 6:58 PM
I want to show the months in my language wich is portuguese, so April should be Abril. Thx in advance for the support =]
#11 by NiDiN on April 9, 2010 - 9:21 PM
please update source code and swc
var dateChooser:DateChooser = new DateChooser();
dateChooser.Months = [“Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”, “Jul”, “Aug”, “Sep”, “Oct”, “Nov”, “Dec”];
addChild(dateChooser);
#12 by Milfont on April 12, 2010 - 6:41 PM
Thank you NiDiN it works great… Is there a similar way to change the week days (S, M, T, W, T, F, S)?
#13 by NiDiN on April 12, 2010 - 8:22 PM
dateChooser.WeekStart = “sunday”;
OR
dateChooser.WeekStart = “monday”;
there are only two options now
#14 by Milfont on April 13, 2010 - 7:42 PM
I guess you got me wrong, what I mean is the same thing that you did with the months, I need to translate the days of the weeks as well. Instead of (S, M, T, W, T, F, S) it should be (D, S, T, Q, Q, S, S) in portuguese. Keep up the good work!
Best regards,
Milfont
#15 by digitaloranges on April 19, 2010 - 2:07 PM
Hello, great work!
However, the .swc doesn’t seem to let me set the dateFormat at all? I need to set the output to DD/MMM/YYYY and althought the docs say I can, it seems that that property isn’t available!
#16 by NiDiN on April 22, 2010 - 2:41 PM
hi,
var dateChooser:DateChooser = new DateChooser();
dateChooser.dateFormat = “D/M/Y”; // available combinations and syntax
dateChooser.dateFormat = “D/Y/M”;
dateChooser.dateFormat = “Y/D/M”;
dateChooser.dateFormat = “Y/M/D”;
dateChooser.dateFormat = “M/Y/D”;
dateChooser.dateFormat = “M/D/Y”;
#17 by Boombar on April 22, 2010 - 10:35 AM
If you want to replace / with something else just add this two lines:
var str:String = e.selectedDate;
var newStr:String = str.split(“/”).join(“.”);
For eg. e.selectedDate will trace 1/4/2010, and newStr will trace 1.4.2010
P.S. Thanks for the component, it works great.
This is useful for me because I take the date value and name the file after it, so I have to replace / since it is not allowed symbol in the file name.
#18 by NiDiN on April 22, 2010 - 2:43 PM
Hi,
reduce it to single line :)
var str:String = String(e.selectedDate).split(“/”).join(“.”);
#19 by Boombar on April 22, 2010 - 11:15 AM
dateChooser.dateFormat = “D/M/Y”;
This is not working for me, and I got the latest DateChooser-V4.swc
1119: Access of possibly undefined property dateFormat through a reference with static type nid.components:DateChooser.
I also noticed that there are different swc files in example file and on google project page… Where is the working one?
#20 by NiDiN on April 22, 2010 - 3:23 PM
Hi Boombar ,
thanks for your feedback and support
i will check the SWC issue and dateFormat and update the asap
#21 by NiDiN on April 22, 2010 - 3:26 PM
hi,
i think i upload old SWC
i will check the SWC and upload latest one shortly
#22 by beanbag on May 8, 2010 - 12:06 PM
How much does this add to the swf file size? Looks good.
#23 by NiDiN on May 8, 2010 - 12:14 PM
28.6kb
#24 by Andy on June 17, 2010 - 2:51 AM
This is a great component,
How could I store the date selected in a sharedObject?
Basically I need to know what the Date(); variable is so I can store it and reload the selected date next time the swf loads. Thanks in advance.
#25 by NiDiN on June 17, 2010 - 8:34 PM
i couldn’t understand your requirement
could you please explain in detail.