sumathimuthu / as3corelib

Automatically exported from code.google.com/p/as3corelib
0 stars 0 forks source link

DateUtil.parseRFC822 method coudl not analize date for as3corelib #50

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by yasuk...@gmail.com on 24 Mar 2008 at 12:43

GoogleCodeExporter commented 8 years ago
42

Original comment by yasuk...@gmail.com on 24 Mar 2008 at 12:44

GoogleCodeExporter commented 8 years ago

Original comment by mikechambers on 2 Jul 2008 at 5:52

GoogleCodeExporter commented 8 years ago
This appears to be a problem for dates without a timezone code for example
DateUtil.parseRFC822('Tue, 17 Mar 2009 14:44:46'); will throw an error. 

This occurs on line 376 "if (timezone.search(/\d/) == -1)" as timezone is null 
(from
var timezone:String = dateParts.shift(); on line 373)

Maybe this should default to UTC if no timezone is specified. 
(if(!timezone)timezone
= "UTC")

Original comment by ric...@gmail.com on 24 Mar 2009 at 4:45

GoogleCodeExporter commented 8 years ago
I'm receiving an error when I run 

import com.adobe.utils.DateUtil;
var pubDate:String = "Mon, 20 Apr 2009 16:12:01 CDT";
DateUtil.parseRFC822(pubDate);

Notice that I am using a timezone code (ie CDT)

Error Thrown as follows:
Error: Unable to parse the string [Mon, 20 Apr 2009 16:12:01 CDT] into a date. 
The
internal error was: TypeError: Error #1009: Cannot access a property or method 
of a
null object reference.
    at com.adobe.utils::DateUtil$/parseRFC822()
    at Untitled_fla::MainTimeline/frame1()

Original comment by johntimo...@gmail.com on 5 May 2009 at 7:28