[EMAIL PROTECTED] wrote:
I tried to write a second script but am getting an IllegalArgumentException on "new Date(millis)":

<!-- usage : <formatdate millis="${millis}" format="yyMMddHHmm" property="formatted"/> -->
<scriptdef name="filedate" language="javascript">
   <attribute name="millis"/>
   <attribute name="format"/>
   <attribute name="property"/>
   <![CDATA[
       millis = attributes.get("millis");
       format = attributes.get("format");
       propName = attributes.get("property");
       d = new java.util.Date(millis);
       f = new java.text.SimpleDateFormat(format);
        y = f.format(d);
       project.setNewProperty(propName, y);
   ]]>
</scriptdef>

Project: public String getProperty(String propertyName)
You have to convert the String into a long.

I tried :
  l = new java.lang.Long (millis);
  d = new java.util.Date(l);

This also results in a IllegalArgumentException when creating the Date.

Also: could I combine the two scripts and return 2 properties if format is specified?

You dont return a property - you store a value in project's
property-hashtable.
And of course you can save muliple values.

Thanks for the explanation. ;-)

--


Gruß aus Schottland,

Tarlika Elisabeth Schmitz

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to