views:

26

answers:

1

I am using a jquery datepicker and timepicker. In datepicker I want to disable the all dates which are past to the current date. And in timepicker I want to show the times which is one hour prior to the current time.Can anyone tell me how to do this?

A: 

Here's part of the answer.

This DatePicker http://jqueryui.com/demos/datepicker/#min-max offers a minDate and maxDate option.

<script>
$(function() {
    $( "#datepicker" ).datepicker({ minDate: -20, maxDate: "+1M +10D" });
});
</script>

Set the beginning and end dates as actual dates (new Date(2009, 1 - 1, 26)), as a numeric offset from today (-20), or as a string of periods and units ('+1M +10D'). For the last, use 'D' for days, 'W' for weeks, 'M' for months, or 'Y' for years.

Like Nick said, there are too many timepickers/datepickers out there to know which ones you are talking about. Update the question and you'll get better help... unless you've already figured it out of course :)

Brandon Boone