<!DOCTYPE html>
<html>
<head>
    <title>AngularJS</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">
    <script src="../../js/jquery.min.js"></script>
    <script src="../../js/angular.min.js"></script>
    <script src="../../js/kendo.all.min.js"></script>
    <script src="../content/shared/js/console.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
        <a class="offline-button" href="../index.html">Back</a>
    
    <div id="example" ng-app="KendoDemos">
    <div class="demo-section k-content" style="width: 600px;" ng-controller="MyCtrl">
        <div class="box-col">
            <h4>Start date: <span ng-show="startDate">{{startDate | date:"MMM d, yyyy"}}</span></h4>
            <kendo-calendar ng-model="startDate" k-rebind="endDate" max="endDate"></kendo-calendar>
        </div>
        <div class="box-col" ng-show="startDate">
            <h4>End date: <span ng-show="endDate">{{endDate | date:"MMM d, yyyy"}}</span></h4>
            <kendo-calendar ng-model="endDate" k-rebind="startDate" min="startDate" max="maxEndDate"></kendo-calendar>
        </div>
    </div>
</div>

<script>
  angular.module("KendoDemos", [ "kendo.directives" ]);

  function MyCtrl($scope) {
      $scope.$watch("startDate", function(val){
          var maxEndDate = new Date(val);
          maxEndDate.setDate(maxEndDate.getDate() + 14);
          $scope.maxEndDate = maxEndDate;
          delete $scope.endDate;
      });
  }
</script>


    
    
</body>
</html>
