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

Bug 360558

Summary: date and timestamp can not be initialized in javascript
Product: z_Archived Reporter: Jing Qian <jqian>
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P1 CC: carrollk, greer
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Additional Variations none

Description Jing Qian CLA 2011-10-11 12:12:01 EDT
This is major, because it blocks all the timestamp and date test cases for services (> 15 test cases)

Try the following RUIhandler

handler h1 type RUIhandler{initialUI =[], onConstructionFunction = start, cssFile = "css/b.css", title = "h1"}



    function start()
		timestamp1 timestamp("yyyyMMddHHmmss") = "2005/02/15-12:30:11";
    	syslib.writeStdOut ("time is:" + timestamp1);
		
		date1 date = "2005/02/15";
    	syslib.writeStdOut ("date is:" + date1);       	
    end
end

You can see the runtime exception in FF browser.

egl.eglx.lang.Constants.$inst is undefined
and 
egl.eglx.lang.Constants.$inst.odbcTimestampFormat is undefined
Comment 1 Kathy Carroll CLA 2011-10-12 09:32:50 EDT
Created attachment 205034 [details]
Additional Variations

Attached related eunit test variations.  Run RunAllTests_RUI
Comment 2 Scott Greer CLA 2011-10-14 13:27:54 EDT
PLEASE note that, according to both Matt and the documentation for EDate.egl,  part of the testcase is incorrect:

   date1 date = "2005/02/15";

String to date conversions must always start with month followed by day followed by year.
Comment 3 Scott Greer CLA 2011-10-14 14:27:39 EDT
Fixed
Comment 4 Jing Qian CLA 2011-10-18 13:30:18 EDT
using 20111018's latest code from cvs (a development environment)

the same code gives 

egl.eglx.lang.TypeCastException is not a constructor error in the FF external browser
Comment 5 Jing Qian CLA 2011-10-18 13:38:56 EDT
oops, I need to change the date to be MM/dd/yyyy format

verified in 201110180901's build