At the moment I have this code here:
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript"><!--
if ($.browser.msie && $.browser.version == 6) {
$('.date, .datetime, .time').bgIframe();
}
$('.date').datepicker({dateFormat: 'D M dd, yy', minDate:2, beforeShowDay: $.datepicker.noWeekends});
$('.datetime').datetimepicker({
dateFormat: 'yy-mm-dd',
timeFormat: 'h:m'
});
$('.time').timepicker({timeFormat: 'h:m'});
//--></script>
It works great by I have one thing I would like to add to it.
I use the datepicker so my customers can choose a date when they can pick up an item.
I would like it to blank out the the next two days after it reaches 5.30pm EST.
So at 1pm on Monday I can only select Wednesday onwards. If it is 6pm Monday I can only order Thursday onwards.
Does anyone know how to do this? I couldn’t quite figure it out from the API website.
Many Thanks
Peter
per the docs: http://jqueryui.com/datepicker/#min-max
you can set
minDate: 2depending on what time it is now.then pass
minintominDate.as ahren pointed out, though, this will be the user’s time, not yours. If you want to find the timezone and adjust from there you can use
getTimeZoneOffsethttp://www.w3schools.com/jsref/jsref_gettimezoneoffset.asp