gigaZhang / struts2-jquery

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

Date formatting doesn't work #1056

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use a custom displayFormat and a String value, like <sj:datepicker 
value="25;03;13" displayFormat="dd;mm;yy"/>

What is the expected output? What do you see instead?
You'd expect to see a datepicker showing the value "25;03;2013" but you get 
"25;01;2013" instead, because the format string for the month ("mm") is not 
java-compatible. 

Which struts2 version? 2.3.15.2

Which struts2-jquery plugin version? 3.6.1

Please provide any additional information below.

The month format in java is "MM" not "mm" but you can't use 
displayFormat="dd;MM;yy" because the JQuery output would be "25;March;2013" 
instead of "25;03;2013".
I guess we need two different parameters, one for specifying the display format 
(JQuery syntax) and one for specifying the parsing format (Java syntax)

Original issue reported on code.google.com by vmlmil...@gmail.com on 25 Oct 2013 at 1:48

GoogleCodeExporter commented 9 years ago
JavaScript date format is not equals to java date format. But anyway it looks 
like a bug in jQuery UI and not like a bug of this plugin. Please register an 
issue there.

http://bugs.jqueryui.com/

Original comment by johgep on 10 Apr 2014 at 7:18