> ## Content Index
> Fetch the complete content index at: https://irishdotnet.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to add one day to the calendar date selected using jquery ui
- URL: https://irishdotnet.dev/how-to-add-one-day-to-the-calendar-date-selected-using-jquery-ui/
- Published: 2010-06-10T08:33:00.000Z
- Updated: 2024-08-05T08:33:45.000Z
- Author: Richard Reddy
- Tags: JavaScript

I recently has an email come into me asking about a previous post I did regarding the [jQuery UI date picker](https://www.reddybrek.com/post/jQuery-UI-date-picker-how-to-set-the-start-date-of-your-second-calendar?ref=irishdotnet.dev). This person was looking for a way to add some extra functionality to the date picker example I had that would auto default to setting the drop off date textbox value to be one day ahead of the pickup date.

To do this all that is required is to add an extra function within the document.ready() function that fires when the pickup date is changed, add one to the date entered and then put that value into the drop off box. The code to do this is:

``````
$('.pUpDate').change(function() {
    var nextDayDate = $('.pUpDate').datepicker('getDate', '+1d');
    nextDayDate.setDate(nextDayDate.getDate() + 1);
    $('.dOffDate').datepicker('setDate', nextDayDate);
});
```

Building on the previous examples [demo](http://www.reddybrek.com/post/jQuery-UI-date-picker-how-to-set-the-start-date-of-your-second-calendar?ref=irishdotnet.dev), below is a link to download a working example that includes the above new code snippet.

[min date jquery demo v1.2min date jquery demo v1.2.zip68 KBdownload-circle](https://irishdotnet.dev/content/files/2024/08/min-date-jquery-demo-v1.2.zip "Download")