So, did you (the current maintainers) think about creating something like a playground for contributions like earlier mentioned on this list? Or do you think the wiki should play that role?
 
Anyway, I think this is a small but usefull patch. In my opinion it is a very common case to work with longs (timestamps) internally where you want to display dates.
 
-- BEGIN
 
Index: DateTool.java
===================================================================
RCS file: /home/cvspublic/jakarta-velocity-tools/src/java/org/apache/velocity/tools/generic/DateTool.java,v
retrieving revision 1.2
diff -u -r1.2 DateTool.java
--- DateTool.java 28 May 2003 00:17:15 -0000 1.2
+++ DateTool.java 2 Jul 2003 20:18:56 -0000
@@ -282,6 +282,12 @@
         {
             return ((Calendar)obj).getTime();
         }
+  if(obj instanceof Long)
+  {
+   Date d = new Date();
+   d.setTime(((Long)obj).longValue());
+   return d;
+  }
         try
         {
             //try parsing the obj as String w/a DateFormat
-- END
 
Eelco
Index: DateTool.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-velocity-tools/src/java/org/apache/velocity/tools/generic/DateTool.java,v
retrieving revision 1.2
diff -u -r1.2 DateTool.java
--- DateTool.java       28 May 2003 00:17:15 -0000      1.2
+++ DateTool.java       2 Jul 2003 20:18:56 -0000
@@ -282,6 +282,12 @@
         {
             return ((Calendar)obj).getTime();
         }
+               if(obj instanceof Long) 
+               {
+                       Date d = new Date();
+                       d.setTime(((Long)obj).longValue());
+                       return d;
+               }
         try
         {
             //try parsing the obj as String w/a DateFormat

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

Reply via email to