Author: ymartel Date: 2012-06-06 11:43:14 +0200 (Wed, 06 Jun 2012) New Revision: 178 Url: http://chorem.org/repositories/revision/chorem/178 Log: Display a datepicker whith time when needed Modified: trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java trunk/chorem-webmotion/src/main/webapp/js/jquery-ui-timepicker-addon.js Modified: trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java 2012-06-05 15:25:22 UTC (rev 177) +++ trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java 2012-06-06 09:43:14 UTC (rev 178) @@ -151,7 +151,11 @@ if (date != null) { value = DateFormatUtils.format(date, "dd/MM/yyyy HH:mm"); } - /*{<input class="datetimepicker" type="date" name="<%=name%>" value="<%=value%>"<%=getDynamicAttribute()%>/>}*/ + if ("datetime".equals(field.getTagValue("subtime"))) { + /*{<input class="datetimepicker" type="date" name="<%=name%>" value="<%=value%>"<%=getDynamicAttribute()%>/>}*/ + } else { + /*{<input class="datepicker" type="date" name="<%=name%>" value="<%=value%>"<%=getDynamicAttribute()%>/>}*/ + } } protected void inputNumeric(JspWriter output, String contextPath, String name, Modified: trunk/chorem-webmotion/src/main/webapp/js/jquery-ui-timepicker-addon.js =================================================================== --- trunk/chorem-webmotion/src/main/webapp/js/jquery-ui-timepicker-addon.js 2012-06-05 15:25:22 UTC (rev 177) +++ trunk/chorem-webmotion/src/main/webapp/js/jquery-ui-timepicker-addon.js 2012-06-06 09:43:14 UTC (rev 178) @@ -870,6 +870,9 @@ if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) return; + // next line added by ymartel on 06/06/12 to display hour in input + this.formattedTime = $.datepicker.formatTime(this._defaults.timeFormat, this, this._defaults); + if (this._defaults.timeOnly === true) { formattedDateTime = this.formattedTime; } else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {