Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360558 - date and timestamp can not be initialized in javascript
Summary: date and timestamp can not be initialized in javascript
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 12:12 EDT by Jing Qian CLA
Modified: 2017-02-23 14:14 EST (History)
2 users (show)

See Also:


Attachments
Additional Variations (1018.57 KB, application/x-zip-compressed)
2011-10-12 09:32 EDT, Kathy Carroll CLA
no flags Details

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