OK, I've made a modified version more suitable for MXML and would love
to get feedback from everyone. Ideally I would be able to bind a field
or label directly to the formatted output and would not require a
click to 'reset' the field that is bound to the formatted value. How
would I accomplish
OK, I've got it working how I wanted. Would love to hear feedback on
my structure as well as whether or not you find this useful.
Usage:
local:QuickDateFormatter id=qdf date={fieldOne.text}
dateFormat={fieldTwo.text} /
mx:Label text={qdf.output}/
Source class:
package
{
import
First of all, I would read Creating and Extending Flex 2 Components
Creating Nonvisual Flex Components Creating Custom Formatters
Creating a custom formatter in the documentation.
The documentation for DateFormatter says that it has a formatString
variable, so you can get rid of str_dateFormat
Thanks gotgoose, I actually realized a lot of that a while after my
post and hadn't gotten a chance to update this thread. Thanks for
pointing me to that section in the help though, there is some good
info there. Upon further review, you can basically do what I was
attempting with the built-in
All you have to do is add public properties like this:
[Bindable]
public var str_dateFormat:String;
[Bindable]
public var str_dateString:String;
--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:
Yea, what I am looking for is some help on what changes would need to
be
Sorry, it attached my comma to the link. Should be
http://www.returnundefined.com/2006/07/quickdateformatter-efficient-date-formatting-in-as3/
Thanks,
Ben
Yahoo! Groups Sponsor ~--
Great things are happening at Yahoo! Groups. See the new email
All you have to do is:In your application mxml file, add this attribute to the Application tag: xmlns:mycode="com.fmr.utils"Then you can add your formatter with this code:mycode:QuickDateFormatter /You use it by adding id="myQuickDateFormatter" to the tag. An alternative is to put this code in
Yea, what I am looking for is some help on what changes would need to
be made to the class to allow it to be used in a format similar to this:
utils:QuickDateFormatter id=qdf str_dateString={model.someDate}
str_dateFormat=MM/DD/YY /
mx:Label text={qdf} /
Thanks,
Ben
8 matches
Mail list logo