function calendarDirective(inputDirective) {
    return {
      template: function(tElement, tAttr) {
        // This allows the calendar to work, without a datepicker. This ensures that the virtual
        // repeater scrolls to the proper place on load by deferring the execution until the next
        // digest. It's necessary only if the calendar is used without a datepicker, otherwise it's
        // already wrapped in an ngIf.
        var extraAttrs = tAttr.hasOwnProperty('ngIf') ? '' : 'ng-if="calendarCtrl.isInitialized"';
        return '' +
          '<div ng-switch="calendarCtrl.currentView" ' + extraAttrs + '>' +
            '<md-calendar-year ng-switch-when="year"></md-calendar-year>' +
            '<md-calendar-month ng-switch-default></md-calendar-month>' +
          '</div>';
      },
      scope: {
        minDate: '=mdMinDate',
        maxDate: '=mdMaxDate',
        dateFilter: '=mdDateFilter',
        monthFilter: '=mdMonthFilter',

        // These need to be prefixed, because Angular resets
        // any changes to the value due to bindToController.
        _mode: '@mdMode',
        _currentView: '@mdCurrentView'
      },
      require: ['ngModel', 'mdCalendar'],
      controller: CalendarCtrl,
      controllerAs: 'calendarCtrl',
      bindToController: true,
      link: function(scope, element, attrs, controllers) {
        var ngModelCtrl = controllers[0];
        var mdCalendarCtrl = controllers[1];
        mdCalendarCtrl.configureNgModel(ngModelCtrl, inputDirective);
      }
    };
  }
@ngdoc directive
@name mdCalendar
@module material.components.datepicker

@param {Date} ng-model The component's model. Should be a Date object.
@param {Object=} ng-model-options Allows tuning of the way in which `ng-model` is being
 updated. Also allows for a timezone to be specified.
 <a href="https://docs.angularjs.org/api/ng/directive/ngModelOptions#usage">Read more at the
 ngModelOptions docs.</a>
@param {Date=} md-min-date Expression representing the minimum date.
@param {Date=} md-max-date Expression representing the maximum date.
@param {(function(Date): boolean)=} md-date-filter Function expecting a date and returning a
 boolean whether it can be selected in "day" mode or not.
@param {(function(Date): boolean)=} md-month-filter Function expecting a date and returning a
 boolean whether it can be selected in "month" mode or not.
@param {String=} md-current-view Current view of the calendar. Can be either "month" or "year".
@param {String=} md-mode Restricts the user to only selecting a value from a particular view.
 This option can be used if the user is only supposed to choose from a certain date type
 (e.g. only selecting the month). Can be either "month" or "day". **Note** that this will
 overwrite the `md-current-view` value.

@description
`<md-calendar>` is a component that renders a calendar that can be used to select a date.
It is a part of the `<md-datepicker>` pane, however it can also be used on it's own.

@usage

<hljs lang="html">
  <md-calendar ng-model="birthday"></md-calendar>
</hljs>