mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
WW-5197 Adds support for java.sql.Date
This commit is contained in:
@@ -293,7 +293,9 @@ public class Date extends ContextBean {
|
||||
final ZoneId tz = getTimeZone();
|
||||
// find the name on the valueStack
|
||||
Object dateObject = findValue(name);
|
||||
if (dateObject instanceof java.util.Date) {
|
||||
if (dateObject instanceof java.sql.Date) {
|
||||
date = ((java.sql.Date) dateObject).toLocalDate().atStartOfDay(tz);
|
||||
} else if (dateObject instanceof java.util.Date) {
|
||||
date = ((java.util.Date) dateObject).toInstant().atZone(tz);
|
||||
} else if (dateObject instanceof Calendar) {
|
||||
date = ((Calendar) dateObject).toInstant().atZone(tz);
|
||||
|
||||
Reference in New Issue
Block a user