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.
如何在 Bootstrap Datepicker 的变量中获取实际月份值?本月“10 月或 10 日”我想保存该值。
我正在使用这个版本,里面的演示: http ://eternicode.github.io/bootstrap-datepicker/?markup=embedded&format=&weekStart=&startDate=&endDate=&startView=0&minViewMode=0&todayBtn=linked&language=pt&orientation=auto#sandbox
使用 jQuery 之类的东西
$('#buttonId').click(function(){ var date = $('#dateFieldID').val(); // "10/11/2013" var month = date.substring(0,2); //Grab first two characters of the date string = 10 alert(month); // here is your month // do something with your month });