Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="bootstrap-datepicker in IE11">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" type="text/css" />
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script>
  
  
  <div class="well">
  <input type="text" id="date-daily" />
</div>
<textarea id="stdout" style="width:100%;height:10em;"></textarea>
  
  
  
</body>
</html>
 
$(document).ready(function() {
  $('#date-daily').datepicker({
      format: 'dd/mm/yyyy',
      assumeNearbyYear: true,
      autoclose: true,
      orientation: 'bottom right',
      todayHighlight: true,
      keyboardNavigation: false
    })
    // OnEnter -> lose focus
    .on('keydown', function(e) {
         if (e.which === 13){ 
           $(this).blur();
         }
    })
    // onPaste -> hide and lose focus
    .on('keyup', function(e) {
         if (e.which === 86){ 
            $(this).blur();
            $(this).datepicker('hide');
          }
    })
    .change(function(e) {
      // console.log('change');
      //console.log('changeDate: ' + $('#date-daily').val());   
      //console.log( $('#stdout').length );
    
      //$('#stdout').focus();
    
      //document.getElementById('date-daily').blur();
       
          
      //$(this).datepicker('hide');
    
      //$(this).blur();
      //$(this).datepicker('hide');
      /*$('#date-daily').datepicker('hide');*/
      $('#stdout').append($('#date-daily').val() + ' change\n');
    });
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
LRHFpro
0viewers