PDA

View Full Version : javascript possibility



kettle_anonymous
03-10-2006, 12:51 PM
hi


I have a javascript step in my transformation and would like to call a common function from a javascript library.



mydate = format_date( srcdate, "DD-MM-YYYY" )
The format_date() function is in a javascript library common.js



How can i do this ?
Jess.

MattCasters
03-10-2006, 03:06 PM
Hi Jess,

I have no idea really.
However, you can format the date like this as well:

mydate = srcdate.dat2str("dd-MM-yyyy").getString();

Hope this helps,

Matt

kettle_anonymous
03-11-2006, 03:29 AM
Thanks Matt,

The above was only an example, I still have many javascript functions that i need to copy to every transformation job every time i need to use it.

Regards
Jess

MattCasters
03-11-2006, 04:01 AM
OK, I get it.
I suppose, the best thing to do is add a feature request tracker for the "include" functionality in javascript. I don't think Rhino or Javascript have an "Include" possibility (am I wrong) but we can do it using Kettle outside of the script.

Thanks for the feedback!
Matt