KB - Wijmo 5 - Oxxx

by Joel Parks

HTML

<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.min.js"></script>
<link rel="stylesheet" href="http://cdn.wijmo.com/5.latest/styles/wijmo.min.css">
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.input.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="http://cdn.wijmo.com/5.latest/interop/angular/wijmo.angular.min.js"></script>
<div ng-app="app" ng-controller="appCtrl">
  <div>
    <wj-calendar
      style="width:300px;"
      value="today"
      min="{{ minDate | date:'yyyy-MM-dd' }}"
      max="{{ maxDate | date:'yyyy-MM-dd' }}"
      format-item="formatItem(s,e)">
    </wj-calendar>
  </div>
</div>

CSS

.wj-calendar .date-holiday {
    /* holidays in calendar */
    color: #008f22;
    outline: 2px solid #008f22;
}
.wj-calendar .date-weekend:not(.wj-state-selected) {
    /* weekends in calendar */
    background-color: #d8ffa6;
}

JavaScript

// declare app module
var app = angular.module('app', ['wj']);

// app controller provides data
app.controller('appCtrl', function($scope) {

    // apply special styles to weekends and holidays
    var numberOfDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    var currentYear = 2020;
    
    $scope.monthButtons = document.getElementsByTagName("button");
    $scope.today = today;
    $scope.minDate = new Date(today.getFullYear(), 1, 1);
    $scope.maxDate = new Date(today.getFullYear(), 1, 31);
    
    monthButtons[0].onclick = function(){
    	console.log('Hello');
    }

    // apply special styles to weekends and holidays
    $scope.formatItem = function (s, e) {
    }
});