Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362612

Summary: StringLib.format(myDate, "M/d/yy") returning null
Product: z_Archived Reporter: broy2
Component: EDTAssignee: Yun Feng Ma <mayunf>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mayunf
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch lasher: iplog+

Description broy2 CLA 2011-11-01 20:04:33 EDT
Use EUNIT to run:

library dateFromGregorian	
    myDate date;
    myString string;
    i int = 19990201;
    function dateFromGregorian(){@Test}
        myDate = dateTimeLib.dateFromGregorian(i);
        myString = StringLib.format(myDate, "M/d/yy");
        LogResult.assertStringEqual("dateFromGregorian", "2/1/99", myString);
    end	
end

dateFromGregorian - Failed: Expected value = '2/1/99' Actual value = 'null'
Comment 1 Yun Feng Ma CLA 2011-11-04 04:14:27 EDT
Created attachment 206449 [details]
Patch

Here is a patch. Thanks.
Comment 2 Yun Feng Ma CLA 2011-11-07 20:05:25 EST
Fixed, add logic to handle single "M" and "d" format. Thanks.
Comment 3 broy2 CLA 2011-11-08 10:25:33 EST
Verified in 20111108 build.