text: var __extends = (this && this.__extends) || (function () {
      var extendStatics = Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
          function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
      return function (d, b) {
          extendStatics(d, b);
          function __() { this.constructor = d; }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
  })();
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
      else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
      return c > 3 && r && Object.defineProperty(target, key, r), r;
  };
  /**
   * Created by mehrabisajad on 2017/03/28.
   */
  import { Injectable } from '@angular/core';
  import { isInteger } from "@ng-bootstrap/ng-bootstrap/util/util";
  import { NgbCalendar } from "@ng-bootstrap/ng-bootstrap";
  var NgbCalendarJalali = (function (_super) {
      __extends(NgbCalendarJalali, _super);
      function NgbCalendarJalali() {
          return _super !== null && _super.apply(this, arguments) || this;
      }
      NgbCalendarJalali.prototype.getDaysPerWeek = function () {
          return 7;
      };
      NgbCalendarJalali.prototype.getMonths = function () {
          return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
      };
      NgbCalendarJalali.prototype.getWeeksPerMonth = function () {
          return 6;
      };
      NgbCalendarJalali.prototype.isValid = function (date) {
          return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) && !isNaN(this.toGregorian(date).getTime());
      };
      NgbCalendarJalali.prototype.setDay = function (date, day) {
          var mDays = this.getDaysInJalaliMonth(date.month, date.year);
          if (day <= 0) {
              while (day <= 0) {
                  date = this.setMonth(date, date.month - 1);
                  mDays = this.getDaysInJalaliMonth(date.month, date.year);
                  day += mDays;
              }
          }
          else if (day > mDays) {
              while (day > mDays) {
                  day -= mDays;
                  date = this.setMonth(date, date.month + 1);
                  mDays = this.getDaysInJalaliMonth(date.month, date.year);
              }
          }
          date.day = day;
          return date;
      };
      NgbCalendarJalali.prototype.setMonth = function (date, month) {
          month = +month;
          date.year = date.year + Math.floor((month - 1) / 12);
          date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;
          return date;
      };
      NgbCalendarJalali.prototype.setYear = function (date, yearValue) {
          date.year = +yearValue;
          return date;
      };
      return NgbCalendarJalali;
  }(NgbCalendar));
  NgbCalendarJalali = __decorate([
      Injectable()
  ], NgbCalendarJalali);
  export { NgbCalendarJalali };
  //# sourceMappingURL=ngb-calendar-jalali.js.map