Issue 692 in struts2-jquery: Timepicker 24 Hour issue

37 views
Skip to first unread message

struts2...@googlecode.com

unread,
Oct 31, 2011, 11:10:11 AM10/31/11
to struts2...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 692 by schweige...@gmail.com: Timepicker 24 Hour issue
http://code.google.com/p/struts2-jquery/issues/detail?id=692

I use the current struts2-jquery Version (3.1.1) with Struts 2.2.3.

Here is an example of my issue. If I use the timepicker additional to the
datepicker and the selected time from the database is a P.M. time, the hour
attribute in the option array is set to the A.M. value.

In my example I selected 20 o'clock (see value), but 8 o'clock is displayed.

<input type="text" name="corporateCustomerOffer.date" value="31.10.2011
20:00:00" disabled="disabled" id="corporateCustomerOfferDate"
style="width:478px"/></div> </div>
<script type='text/javascript'>
jQuery(document).ready(function () {
var options_corporateCustomerOfferDate = {};
options_corporateCustomerOfferDate.day = 31;
options_corporateCustomerOfferDate.month = 9;
options_corporateCustomerOfferDate.year = 2011;
options_corporateCustomerOfferDate.hour = 8;
options_corporateCustomerOfferDate.minute = 0;
options_corporateCustomerOfferDate.second = 0;
options_corporateCustomerOfferDate.showOn = "focus";
options_corporateCustomerOfferDate.buttonImage
= "/booking/struts/js/calendar.gif";
options_corporateCustomerOfferDate.duration = "fast";
options_corporateCustomerOfferDate.showAnim = "slideDown";
options_corporateCustomerOfferDate.displayformat = "dd.mm.yy";
options_corporateCustomerOfferDate.timepicker = true;
options_corporateCustomerOfferDate.jqueryaction = "datepicker";
options_corporateCustomerOfferDate.id = "corporateCustomerOfferDate";
options_corporateCustomerOfferDate.name = "corporateCustomerOffer.date";

jQuery.struts2_jquery.bind(jQuery('#corporateCustomerOfferDate'),options_corporateCustomerOfferDate);

});
</script>


struts2...@googlecode.com

unread,
Oct 31, 2011, 12:28:20 PM10/31/11
to struts2...@googlegroups.com

Comment #1 on issue 692 by schweige...@gmail.com: Timepicker 24 Hour issue
http://code.google.com/p/struts2-jquery/issues/detail?id=692

Here is my struts tag:

<sj:datepicker id="corporateCustomerOfferDate"
key="corporateCustomerOffer.date" displayFormat="dd.mm.yy"

value="%{getText('fieldFormat.date',{corporateCustomerOffer.date.getTime()})}"
disabled="disabledValue" cssStyle="width:478px"
timepickerStepMinute="15"
showOn="focus" showAnim="slideDown" duration="fast" timepicker="true" />

struts2...@googlecode.com

unread,
Oct 31, 2011, 12:42:34 PM10/31/11
to struts2...@googlegroups.com

Comment #2 on issue 692 by schweige...@gmail.com: Timepicker 24 Hour issue
http://code.google.com/p/struts2-jquery/issues/detail?id=692

I enabled the timepickerAmPm="true" option. It's like i said. If I select a
PM timestamp and save it to the database. Everything is fine. But if I load
a value from the database like '31.10.2011 20:00:00', the value is
automatically set to AM.

struts2...@googlecode.com

unread,
Oct 31, 2011, 1:28:00 PM10/31/11
to struts2...@googlegroups.com

Comment #3 on issue 692 by schweige...@gmail.com: Timepicker 24 Hour issue
http://code.google.com/p/struts2-jquery/issues/detail?id=692

Found the bug:

DatePicker.java Line 419

addParameter("hourValue", "" + calendar.get(Calendar.HOUR));

should be

addParameter("hourValue", "" + calendar.get(Calendar.HOUR_OF_DAY));

struts2...@googlecode.com

unread,
Oct 31, 2011, 1:49:31 PM10/31/11
to struts2...@googlegroups.com

Comment #4 on issue 692 by schweige...@gmail.com: Timepicker 24 Hour issue
http://code.google.com/p/struts2-jquery/issues/detail?id=692

After building the new version with the change above. Everything works fine!

struts2...@googlecode.com

unread,
Oct 31, 2011, 3:56:51 PM10/31/11
to struts2...@googlegroups.com
Updates:
Status: Accepted
Owner: johgep
Labels: Component-Plugin

Comment #5 on issue 692 by johgep: Timepicker 24 Hour issue
http://code.google.com/p/struts2-jquery/issues/detail?id=692

Thank you for investing time to find out the solution.

struts2...@googlecode.com

unread,
Oct 31, 2011, 4:30:16 PM10/31/11
to struts2...@googlegroups.com
Updates:
Status: Started
Labels: Milestone-3.2.0

Comment #6 on issue 692 by johgep: Timepicker 24 Hour issue
http://code.google.com/p/struts2-jquery/issues/detail?id=692

http://code.google.com/p/struts2-jquery/source/detail?r=1549

Reply all
Reply to author
Forward
0 new messages