As a followup to my own posting: Sorry for not reading properly, of
course your problem does not really relate to output formatting.

Guillaume is right here IMO, for a fixed Date format a custom
TypeConverter should be the way to go, as long as the datepicker does
not work for you.

Regards,
Rene

Rene Gielen schrieb:
> You might want to read here:
> http://struts.apache.org/2.x/docs/formatting-dates-and-numbers.html
> 
> Cheers,
> Rene
> 
> 
> akinss wrote:
>> I'm trying to use a textfield tag for date input.  I need to format this
>> in
>> the form dd/MM/yyyy HH:mm:ss
>>
>> The teaxtfield tag formats the date to a Locale based format
>> DateFormat.SHORT  via XWorkBasicConverter.  For my locale this turns out
>> to
>> be dd/MM/yy. This is not the format I want.
>>
>> <s:textfield  cssClass="field" key="filter.dateTimeStart"
>> name="filter.dateTimeStart"/>
>>
>> DateTimePicker wont allow you to apply a style class to the input field so
>> it wont format.  Bug has been reported in Struts JIRA (WW-1778) and a fix
>> made.  Need to wait for Struts 2.1 before this will work so I can't use
>> this.
>>
>> Using the value parameter and a date tag won't work because this
>> overwrites
>> the value entered.  If the user enters a value that can't be converted to
>> a
>> date it isn't re-displayed, the field is displayed empty.
>>
>> <s:textfield  cssClass="field" key="filter.dateTimeStart"
>> name="filter.dateTimeStart">
>>   <s:param name="value">
>>     <s:date name="filter.dateTimeStart" format="dd/MM/yyyy HH:mm:ss" />
>>   </s:param>
>> </s:textfield>
>>
>> In the S2 guide for Type Conversion (
>> http://struts.apache.org/2.x/docs/type-conversion.html) it has a note
>> saying
>> not to use Type Conversion for dates.
>>
>> Does anyone know of a way to do this?
>>
>>
>> Thanks in advance.
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to