Wijmo 5 - Date and Time Input

by Manish Gupta

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.grapecity.com/wijmo/5.latest/styles/wijmo.min.css">
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.min.js"></script>
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.input.min.js"></script>
<div class="container">

  <h1>
    Date and Time input
  </h1>


   
  <div id="theInputDate"></div>
</div>

CSS

.wj-calendar {
    max-width: 300px;
}
.wj-control {
  margin-bottom: 6px;
}
body {
  margin-bottom: 24pt;
}

JavaScript

onload = function() {

    // the date/time being edited
    var theDate = new Date();
    
    // create InputDate control
    var inputDate = new wijmo.input.InputDate('#theInputDate', {
        min: new Date(2014, 8, 1),
        format: 'yyyy',
        selectionMode:2,
        value: theDate,
        isDroppedDownChanged:function(s,e){
          setTimeout(function(){
          	var _hdr = s.dropDown.querySelector(".wj-calendar-year tr.wj-header td");
          	console.log(_hdr)
          	_hdr.click();
          },100)
        }
    });
}