Tx Matt, 

after reading the suggested link and a bit more about struts2 type
conversion I came up with a quick "meet the requirements" solution as
follows which may be improved as I became more confortable with this
conversion model:

1)Altered the default Appgen generated calendar parameters on jsp entry
page. Added the following javascript parameters:

 ifFormat: "%d/%m/%Y %H:%M", button: "refeicao.dataHoraDatePicker",
showsTime:true

This needs improvement but is a first working version of calendar with date
and time to pick anyway.

2) Create a specific conversion class called DateTimeConverter for my action
and placed under util package alongside with DateUtil, etc... this class is
similar to DateConverter also in util package with few changes where I call
DateUtil.getDateTimePattern() instead of DateUtil.getDatePattern() also I
create a new method DateUtil.convertDateTimeToString() and used in my new
converter as well.


3) Registered my converter class creating a file named
RefeicaoAction-validation.xml (RefeicaoAction is the name of the action
class where I need to use the converter. This pattern must be followed
according to docs), in RefeicaoAction-validation.xml I registered the field
I want the coverter applyied to: 

refeicao.dataHora=br.com.maweb.controlepeso.util.DateTimeConverter  

This worked just fine for inserts. 

Now I need to make displiay tag show the time when rendering results for
this entry ass well, It´s actually a collection of objects of type Refeicao
wich I need to apply the same conversion pattern. Any ideas or suggestions
on this?








mraible wrote:
> 
> You should modify DateConverter or change xwork.properties to use your own
> class. If you don't have xwork-conversion.properties, you're not using
> full-source. You should be able to override the default by adding your own
> src/main/resources/xwork-conversion.properties with the following:
> 
> java.util.Date=org.appfuse.webapp.action.DateConverter
> 
> More on this at:
> 
> http://www.opensymphony.com/xwork/wikidocs/Type%20Conversion.html
> 
> Matt
> 
> On Tue, Jan 20, 2009 at 12:35 PM, mmaia <[email protected]> wrote:
> 
>>
>> Hi,
>>
>> I'm usind appfuse with struts2. In some situations I need an insert to
>> use
>> a
>> date+time patter wich I can see looking at DateUtil class that is already
>> made in a method called: getDateTimePattern . Also sometimes I need the
>> display tag to show Date and time and also would like to use
>> getDateTimePattern instead of getDatePattern. How should it be done?
>>
>>
>> tx in advance,
>> regards.
>> --
>> View this message in context:
>> http://www.nabble.com/DateUtil.-How-do-I-choose-to-use-date-or-dateTime-format--tp21570028s2369p21570028.html
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DateUtil.-How-do-I-choose-to-use-date-or-dateTime-format--tp21570028s2369p21593749.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to