0
votes

how do i get the actual month value in a variable in Bootstrap Datepicker? this month "October or 10" i want to save that value.

I'm using this version, demo inside: http://eternicode.github.io/bootstrap-datepicker/?markup=embedded&format=&weekStart=&startDate=&endDate=&startView=0&minViewMode=0&todayBtn=linked&language=pt&orientation=auto#sandbox

1
Using jQuery you could grab the value of the date field and then parse the value to get your month.Trevor
I Know the value is in the date inside of the javascript but i don't know how to get it out.user2599982
I answered it but it would be helpful to see your code.Trevor

1 Answers

0
votes

using jQuery something like

$('#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
});