Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何Datepicker在 jqueryUI 中为内联设置日期?
Datepicker
初始化日期选择器时,您将使用以下defaultDate选项:
defaultDate
$("#date").datepicker({ defaultDate: '01/26/2014' });
小提琴
稍后更改日期时,您将使用setDate方法:
setDate
$("#date").datepicker(); // more code $("#date").datepicker('setDate', '01/26/2014');
您也可以使用以下方法设置多个日期:
allBookings = [] _.each(Session.get('thisGuide').bookings,function(e){ allBookings.push(moment(e).format('MM/DD/YYYY')) }) $('#datepicker').datepicker('setDates',allBookings)