I’ve been using a custom formatter that extends mx.formatters.DateFormatter.  
Here’s the code:

 

package tl.formatters

{

            import mx.formatters.DateFormatter;

 

            public class DateFormatter extends mx.formatters.DateFormatter()

{

            super();

}

 

            override public function format(value:Object):String{

                        var str:String = value.toString();

                        if(str.search(“T”) != -1){

            str = str.split(“T”)[0];

            return super.format(str);

}else{

            return super.format(value);

}

}

}

 

 

If you find something better, definitely let me know.  Hope that helps!

 

-tom

  _____  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Samuel 
R. Neff
Sent: Friday, January 05, 2007 1:32 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Is there a framework function to parse XSD compliant 
dateTime from XML?

 


We're using HTTPService to send/receive XML to our server. Some of the XML has 
dates in it in standard XSD dateTime format.

ex: 2002-10-10T12:00:00−05:00

http://www.w3. <http://www.w3.org/TR/xmlschema11-2/#dateTime> 
org/TR/xmlschema11-2/#dateTime

Can we access a player or framework function to parse this string into a Date 
object? The functionality must exist since Flex supports SOAP, but I couldn't 
find anything in the help to just parse a date. Date.parse() didn't accept this 
format (and it wouldn't according to the docs).

I have JavaScript code to parse out the format which we can convert to AS but 
we'd prefer to use what's already built-in.

Thanks,

Sam

 

Reply via email to