Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362612 - StringLib.format(myDate, "M/d/yy") returning null
Summary: StringLib.format(myDate, "M/d/yy") returning null
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Yun Feng Ma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-01 20:04 EDT by broy2 CLA
Modified: 2017-02-23 14:19 EST (History)
1 user (show)

See Also:


Attachments
Patch (3.23 KB, patch)
2011-11-04 04:14 EDT, Yun Feng Ma CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.