Edit: This project is now on github: git://github.com/danjarvis/DateTimeChooser.git
The Flex UIComponents for Dates, namely DateField and DateChooser let you easily collect date information from the users of your application(s). However, and I’m not exactly sure why, but these components lack an interface for choosing time. The application I’m currently working on deals heavily with Date/Time – thus this was a major issue for me.
A quick search on Google returns a bunch of custom components which solve the issue of choosing Date/Time in Flex. While a few of the components I found would have been fine for my use I decided to roll my own, mainly for educational purposes.
This component can be customized in several different ways. Additionally, all of the children (e.g. NumericSteppers) are exposed so that styles can be applied. Let me know if you have any questions on some of the properties as I am only showing the basics here.
Source can be downloaded here.
Enjoy!
Thanks for the component.
Date control provided in the flex3 has rangeStart and rangeEnd for limiting the date.
Does this control limits the time based on these settings?
If not then i have to add this functionality to this component.
Have u tried TimeInput and TimeStepper in ‘ASTRA Flex Components’?
Hey there. This component exposes the internal dateField. As such you can use all properties from that component, including rangeStart and rangeEnd:
myDateTimeChooser.dateField.rangeStart = [];
And no, I have not used any of the ASTRA Flex Components.
Thanks for the reply
Date portion of the control is working fine. I want to restrict time portion of the control based on the given range in the datefield.
What will i have to do in order to achive that?
Is there any event in which i can check the selected date and if it falls outside the required range i could cancel that event.
I see. This component does not yet support restrictions on time.
Anytime a minute or hour is changed the DateTimeChanged event is fired. I use two of these components in an application that has a start time and an end time. The end time cannot be greater than the start time. As such I am listening for the DateTimeChanged event and determining if the date / time selections are valid.
It would be better to limit what times can be selected. You can implement this functionality if you please. I may have time to do it in the near future.
Lastly, I’ve been meaning get this project hosted on GitHub so I’ll be doing that this week as well.
Thanks.
I tried this example….but it throws this error
unable to open ‘C:\Documents and Settings\Devesh\My Documents\Flex Builder 3\DateTimeChooser\libs’
kindly tell me how to recover from this error…
waiting for ur response…
Just create the folder ‘libs’ in that location and it should compile…
[...] writing custom components in Flex (and more or less writing anything to do with DisplayObjects in Flex) you find yourself [...]