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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Brahma Prakash ShuklaRank #633 · 3.8K reputationPosted Dec 8, 2022, 1:30 AM EST
@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.
Aravind GovindarajRank #430 · 5.8K reputationPosted Dec 6, 2022, 6:08 AM EST
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
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 6, 2022, 11:03 PM EST
You can try this one,
$(function() { $( "#datepicker" ).datepicker({ dateFormat: "dd/mm/yyyy" }); });https://www.aspdotnet-suresh.com/2015/05/jquery-ui-datepicker-change-date-format-yyyy-mm-dd-mm-yy.html
Brahma Prakash ShuklaRank #633 · 3.8K reputationPosted Dec 7, 2022, 10:58 AM EST
Both solutions are not working..it will set the date in their input field also.
Pankajkumar PatelRank #181 · 13.4K reputationPosted Dec 8, 2022, 12:30 AM EST
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!
Pankajkumar PatelRank #181 · 13.4K reputationPosted Dec 8, 2022, 1:56 AM EST
Hope this will work!