I’m working on debugging issues I’m having porting the Date.js library to Servoy. See: http://www.datejs.com
For the most part, the library works in Servoy, by just dumping the contents into a global function, and running it to extend the environment. Most of it’s functions extend the Date, Number objects and their prototypes. The test suite passes for these functions.
The exception, however, is the “parse” method, which takes a string and parses a date from it, using some very cool, naturally language friendly constructs. This library is well tested, and runs well in all browsers. It also runs in Rhino – I’ve used the Rhino shell for versions 1.6R7 and 1.7R1 to test my code, and the all the methods behave as expected.
I’ve even run it in the Rhino shell wrapped in a function to make sure I wasn’t adopting any scoping issues from having it wrapped in a global function.
Inside Servoy, however, the parse routine only sort of works. Many standard formats are recognized (like ‘t’ for today, ‘+5 years’, etc.), but date formats and partial date formats do not work…examples, "7/1’, “Jul 1”, etc. – which all work great in Date.js in any other environment, but not in Servoy.
The parse method makes extensive use of regex. I’m working on stepping through the debugger in tandem in Firefox/Firebug, and Servoy, to try to locate places where the logic is breaking down, but was hoping that someone on the engineering team might have some insight on where to look for failure points due to any special issues on the way Rhino is embedded in Servoy.
Thanks for any ideas. I have some very cool stuff to use this library for and will be sure to share them, if I can get past these last few bugs.
greg.