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:
Musachy Barroso
2007-02-28 02:48:06 +00:00
parent f829f52b6b
commit 150fec2256
@@ -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 {