mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
WW-1777 DateTimePicker now supports expressions in the property "displayFormat"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@512580 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -299,13 +299,13 @@ public class DateTimePicker extends UIBean {
|
||||
// try to parse a date
|
||||
String dateStr = obj.toString();
|
||||
if(dateStr.equalsIgnoreCase("today"))
|
||||
return RFC3339_FORMAT.format(new Date());
|
||||
return RFC3339_FORMAT.format(new Date());
|
||||
|
||||
try {
|
||||
Date date = null;
|
||||
if(this.displayFormat != null) {
|
||||
SimpleDateFormat format = new SimpleDateFormat(
|
||||
this.displayFormat);
|
||||
(String) getParameters().get("displayFormat"));
|
||||
date = format.parse(dateStr);
|
||||
return RFC3339_FORMAT.format(date);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user