Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363356 - StringLib.format(myDate with different patterns returns null
Summary: StringLib.format(myDate with different patterns returns 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: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-09 12:03 EST by broy2 CLA
Modified: 2017-02-23 14:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description broy2 CLA 2011-11-09 12:03:30 EST
Use EUNIT to run:

library formatDate
	result string;
	myDate date = "04/07/2015";
    function formatDate2(){@Test}
        result = StringLib.format(myDate, "EEE, MMM, d, ''yy");  
        LogResult.assertStringEqual("formatDate2", "Tue, Apr, 7, '15", result);
    end
    function formatDate3(){@Test}
        result = StringLib.format(myDate, "yyyyy.MMMMM.dd GGG");	
        LogResult.assertStringEqual("formatDate3", "02015.April.07 AD",
                result);
    end
    function formatDate4(){@Test}
        result = StringLib.format(myDate, "yyyy.MM.dd G");					
        LogResult.assertStringEqual("formatDate3", "2015.04.07 AD", result);
    end	
end

All fail.

formatDate::formatDate2: FAILED - formatDate2 - Failed: Expected value = 'Tue, Apr, 7, '15' Actual value = 'null' 
formatDate::formatDate3: FAILED - formatDate3 - Failed: Expected value = '02015.April.07 AD' Actual value = 'null' 
formatDate::formatDate4: FAILED - formatDate3 - Failed: Expected value = '2015.04.07 AD' Actual value = 'null' 

Pattern "MM/dd/yyyy" works OK.
Comment 1 broy2 CLA 2011-11-21 16:04:31 EST
Fixed in 20111121 build.
Comment 2 broy2 CLA 2011-11-21 16:04:42 EST
Verified.