all files / app/main/components/material-docs/demo-partials/datepicker/demoBasicUsage/ script.js

14.29% Statements 1/7
0% Branches 0/2
0% Functions 0/2
14.29% Lines 1/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                                      
angular.module('datepickerBasicUsage',
    ['ngMaterial', 'ngMessages']).controller('AppCtrl', function($scope) {
  $scope.myDate = new Date();
 
  $scope.minDate = new Date(
      $scope.myDate.getFullYear(),
      $scope.myDate.getMonth() - 2,
      $scope.myDate.getDate());
 
  $scope.maxDate = new Date(
      $scope.myDate.getFullYear(),
      $scope.myDate.getMonth() + 2,
      $scope.myDate.getDate());
 
  $scope.onlyWeekendsPredicate = function(date) {
    var day = date.getDay();
    return day === 0 || day === 6;
  };
});