Get today's date from jquery datepicker

无人久伴 提交于 2019-12-01 07:04:35

Yes, the currentText is what you are looking for.

$('#txtSelectedDate').datepicker({
    showButtonPanel: true,
    currentText: "Today:" + $.datepicker.formatDate('MM dd, yy', new Date())  
});​

DEMO

If you need to initialize the datepicker with current date, you could use:

$(".selector").datepicker( "option", "gotoCurrent", true );

And of course you have the dateFormat which take a format defined here

If you need to initialize the datepicker with current date, you could use:

 $(".selector").datepicker( "option", "gotoCurrent", true );
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!