How can I change the default current date of datepicker to any other date when we click on the datepicker.
Condition - By default input field is blank
On click of datepicker it will open from the another month suppose 11/11/2021 by default.
How can I change the default current date of datepicker to any other date when we click on the datepicker.
Condition - By default input field is blank
On click of datepicker it will open from the another month suppose 11/11/2021 by default.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankajkumar PatelPosted Dec 8, 2022, 6:56 AM
Hope this will work!
Brahma Prakash ShuklaPosted Dec 8, 2022, 6:30 AM
@pankaj Patel- Your solution will set the date on input field too. But I want to show date only on calendar of datepicker not in the input field.
Pankajkumar PatelPosted Dec 8, 2022, 5:30 AM
Hi Brahma Prakash Shukla,
You can set default date using defaultDate:"09/22/2019" as like in following example:
For more details:
Hope this will help you!
Brahma Prakash ShuklaPosted Dec 7, 2022, 3:58 PM
Both solutions are not working..it will set the date in their input field also.
Jignesh KumarPosted Dec 7, 2022, 4:03 AM
You can try this one,
https://www.aspdotnet-suresh.com/2015/05/jquery-ui-datepicker-change-date-format-yyyy-mm-dd-mm-yy.html
Aravind GovindarajPosted Dec 6, 2022, 11:08 AM
If you are using the js library, expose the wrapper method and pass the addonmonth as input from your application to the js library. otherwise, when the date picker is clicked, follow the code below
$( ".bhj" ).datepicker({dateFormat:"yy/mm/dd"}).datepicker("setDate",new Date(next month date));
reference :
https://stackoverflow.com/questions/44215862/how-make-default-current-date-in-selectable-in-jquery-date-picker