text: import { range } from '../helpers';
  export var NbDateTimeUtil;
  (function (NbDateTimeUtil) {
      NbDateTimeUtil.DAYS_IN_WEEK = 7;
      NbDateTimeUtil.markIfHoliday = function (name, i) { return ({ name: name, isHoliday: i % 6 === 0 }); };
      NbDateTimeUtil.createDate = function (year, month, date) {
          var result = new Date(year, month, date);
          // We need to correct for the fact that JS native Date treats years in range [0, 99] as
          // abbreviations for 19xx.
          if (year >= 0 && year < 100) {
              result.setFullYear(result.getFullYear() - 1900);
          }
          return result;
      };
      NbDateTimeUtil.isSameYear = function (date1, date2) {
          return date1.getFullYear() === date2.getFullYear();
      };
      NbDateTimeUtil.isSameYearSafe = function (date1, date2) {
          return date1 && date2 && NbDateTimeUtil.isSameYear(date1, date2);
      };
      NbDateTimeUtil.isSameMonth = function (date1, date2) {
          return NbDateTimeUtil.isSameYear(date1, date2) &&
              date1.getMonth() === date2.getMonth();
      };
      NbDateTimeUtil.isSameMonthSafe = function (date1, date2) {
          return date1 && date2 && NbDateTimeUtil.isSameMonth(date1, date2);
      };
      NbDateTimeUtil.isSameDay = function (date1, date2) {
          return NbDateTimeUtil.isSameMonth(date1, date2) &&
              date1.getDate() === date2.getDate();
      };
      NbDateTimeUtil.isSameDaySafe = function (date1, date2) {
          return date1 && date2 && NbDateTimeUtil.isSameDay(date1, date2);
      };
      NbDateTimeUtil.compareDates = function (date1, date2) {
          return date1.getTime() - date2.getTime();
      };
      NbDateTimeUtil.isBetween = function (date, start, end) {
          return NbDateTimeUtil.compareDates(date, start) > 0 && NbDateTimeUtil.compareDates(date, end) < 0;
      };
      NbDateTimeUtil.clone = function (date) {
          return new Date(date.getTime());
      };
      NbDateTimeUtil.getMonthStart = function (date) {
          return NbDateTimeUtil.createDate(date.getFullYear(), date.getMonth(), 1);
      };
      NbDateTimeUtil.getMonthEnd = function (date) {
          return NbDateTimeUtil.createDate(date.getFullYear(), date.getMonth() + 1, 0);
      };
      NbDateTimeUtil.getYearStart = function (date) {
          return NbDateTimeUtil.createDate(date.getFullYear(), 0, 1);
      };
      NbDateTimeUtil.getYearEnd = function (date) {
          return NbDateTimeUtil.createDate(date.getFullYear(), 11, 31);
      };
      NbDateTimeUtil.getNumberOfDaysInMonth = function (date) {
          return NbDateTimeUtil.getMonthEnd(date).getDate();
      };
      NbDateTimeUtil.addDay = function (date, num) {
          return NbDateTimeUtil.createDate(date.getFullYear(), date.getMonth(), date.getDate() + num);
      };
      NbDateTimeUtil.addMonth = function (date, num) {
          return NbDateTimeUtil.createDate(date.getFullYear(), date.getMonth() + num, date.getDate());
      };
      NbDateTimeUtil.addYear = function (date, num) {
          return NbDateTimeUtil.createDate(date.getFullYear() + num, date.getMonth(), date.getDate());
      };
      NbDateTimeUtil.createDateRangeForMonth = function (date) {
          var daysInMonth = NbDateTimeUtil.getNumberOfDaysInMonth(date);
          return range(daysInMonth, function (i) {
              var year = date.getFullYear();
              var month = date.getMonth();
              return NbDateTimeUtil.createDate(year, month, i + 1);
          });
      };
  })(NbDateTimeUtil || (NbDateTimeUtil = {}));
  //# sourceMappingURL=date-time-util.js.map