You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Musachy Barroso (JIRA)" <ji...@apache.org> on 2007/05/20 21:54:43 UTC
[jira] Resolved: (WW-1792) Date tag doesn't handle calendars
[ https://issues.apache.org/struts/browse/WW-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Musachy Barroso resolved WW-1792.
---------------------------------
Resolution: Fixed
Fix Version/s: (was: 2.1.x)
2.1.0
> Date tag doesn't handle calendars
> ---------------------------------
>
> Key: WW-1792
> URL: https://issues.apache.org/struts/browse/WW-1792
> Project: Struts 2
> Issue Type: Improvement
> Components: Views
> Affects Versions: 2.0.6
> Reporter: Mike Baroukh
> Assigned To: Musachy Barroso
> Priority: Minor
> Fix For: 2.1.0
>
> Attachments: Date.diff
>
>
> in org.apache.struts2.component.Date, the following code
> try {
> date = (java.util.Date) findValue(name);
> } catch (Exception e) {
> LOG.error("Could not convert object with key '" + name
> + "' to a java.util.Date instance");
> // bad date, return a blank instead ?
> msg = "";
> }
> can handle only Date.
> There is many case where Calendars are used instead of Date and handling Calendar would be trivial :
> try {
> Object o = findValue(name);
> if (o!=null) {
> if (o instanceof java.util.Calendar) {
> date = ((java.util.Calendar)o).getTime();
> } else {
> date = (java.util.Date) o;
> }
> }
> } catch (Exception e) {
> LOG.error("Could not convert object with key '" + name
> + "' to a java.util.Date instance");
> // bad date, return a blank instead ?
> msg = "";
> }
> this way, we will not have to call with "obj.time()" anymore resulting in less ognl calls ...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.