0

如何在 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

4

1 回答 1

0

使用 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
});
于 2013-10-11T13:08:16.257 回答