awaisalvi / struts2-jquery

Automatically exported from code.google.com/p/struts2-jquery
0 stars 0 forks source link

datepicker don't format the date when return o render #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
In action has field 
import java.util.Date;
private Date dateTest; //value i.e. 04 dec 2009

JSP has tag:
<sj:datepicker parentTheme="simple"  name="dateTest" displayFormat="dd-mm-
yyyy"/>

What is the expected output? What do you see instead?

espected:
<input type="text" value="12/4/09" name="dateTest"/>

instead:
<input type="text" value="04-12-2009" name="dateTest"/>

Which struts2 version?
2.1.8

Which struts2-jquery plugin version?
1.8.0

Please provide any additional information below.

I don't now if this is a datapicker's bug or is how render type 
java.util.Date . When submit a form wich this submit correctly, but when 
recover data form action and populate the field this fail in format.

Original issue reported on code.google.com by mma...@gmail.com on 16 Dec 2009 at 1:17

GoogleCodeExporter commented 9 years ago
did it work with jQuery format strings?
http://docs.jquery.com/UI/Datepicker/formatDate

I think it must be in your cas d/M/y

Original comment by johgep on 16 Dec 2009 at 4:03

GoogleCodeExporter commented 9 years ago
I saw my case was displayFormat="dd-mm-yy" 
because said: yy - year (four digit).

But I tried <sj:datepicker value="today" id="date3" name="date3" 
displayFormat="dd.mm.yy" label="Today" /> like example http://code.google.com/p/
struts2-jquery/wiki/DatePickerTag 

and tried with jquery formats.
<sj:datepicker name="dataTest" parentTheme="simple" displayFormat="dd-mm-yy"/>
<sj:datepicker name="dataTest" parentTheme="simple" displayFormat="yy-mm-dd"/>
<sj:datepicker name="dataTest" parentTheme="simple" displayFormat="D, dd M yy"/>

but this always returns  value="12/4/09" .. may be is jquery problem. :(

Original comment by mma...@gmail.com on 16 Dec 2009 at 6:23

GoogleCodeExporter commented 9 years ago
did it work with new version 1.8.1?
There are some changes in the DatePicker Tag.

Original comment by johgep on 8 Jan 2010 at 9:55

GoogleCodeExporter commented 9 years ago

Original comment by johgep on 25 Jan 2010 at 10:00