I could not resolve the parsing date/time error from Struts2 jquery tag datepicker when setting the minDate. Have tried both date and timestamp as the minDate parameter but the error is still showing. There is no online solution so to seek for some solutions here. I require the datetime format to be (dd M yy HH:mm:ss). Error is logged by timepicker v1.6.3.
Error Line
e.timepicker.log = function() {
window.console && window.console.log && window.console.log.apply && window.console.log.apply(window.console, Array.prototype.slice.call(arguments))
}
Library
JSP
<%@ taglib uri="/struts-jquery-tags" prefix="sj" %>
<sj:datepicker key="document.startDate" size="20" maxlength="20" readonly="true" id="startDate" changeMonth="true" changeYear="true" timepicker="true" showButtonPanel="true" showOn="focus" displayFormat="dd M yy" minDate="-3m +0d" maxDate="+12m +0d" requiredLabel="true" timepickerFormat="HH:mm:ss"/>
Javascript
$('#startDate').datepicker("option", "minDate", new Date("01 Oct 2016"));
Error shown in console:
Error parsing the date/time string: Unexpected literal at position 6
date/time string = 01 Jan 2021
timeFormat = HH:mm:ss
dateFormat = dd M yy