Update to handle Calendar objects.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1613 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -22,6 +22,7 @@ package com.samskivert.velocity;
|
|||||||
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@@ -163,6 +164,8 @@ public class I18nTool
|
|||||||
return new Date(((Long)arg).longValue());
|
return new Date(((Long)arg).longValue());
|
||||||
} else if (arg instanceof Date) {
|
} else if (arg instanceof Date) {
|
||||||
return (Date)arg;
|
return (Date)arg;
|
||||||
|
} else if (arg instanceof Calendar) {
|
||||||
|
return ((Calendar)arg).getTime();
|
||||||
} else {
|
} else {
|
||||||
System.err.println("Date provided with invalid argument " +
|
System.err.println("Date provided with invalid argument " +
|
||||||
"[arg=" + arg + ", aclass=" +
|
"[arg=" + arg + ", aclass=" +
|
||||||
|
|||||||
Reference in New Issue
Block a user