<!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/jszip.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" ng-controller="MyCtrl">
        <div>
            <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 ng-show="startDate" style="padding-top: 1em;">
            <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>
    <style>
        .demo-section {
            text-align: center;
        }
    </style>
</div>

<script>
  angular.module("KendoDemos", [ "kendo.directives" ])
        .controller("MyCtrl", function($scope){
            $scope.startDate = new Date();
            $scope.endDate = new Date();
            $scope.maxEndDate = new Date();

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


    
</body>
</html>
