"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Calendar = void 0;
var _ = __importStar(require("lodash"));
var moment_1 = __importDefault(require("moment"));
var CalendarService = (function () {
    function CalendarService() {
        this.weeksName = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];
        this.monthsName = [
            'Janeiro',
            'Fevereiro',
            'Março',
            'Abril',
            'Maio',
            'Junho',
            'Julho',
            'Agosto',
            'Setembro',
            'Outubro',
            'Novembro',
            'Dezembro',
        ];
    }
    CalendarService.prototype.getMonth = function (month, year) {
        var monthMoment = moment_1.default().date(1).month(month).year(year);
        var currentMonth = monthMoment.month();
        var nextMonth = moment_1.default(monthMoment).add(1, 'M').month();
        var previousMonth = moment_1.default(monthMoment).subtract(1, 'M').month();
        monthMoment.subtract(monthMoment.day(), 'day');
        var today = moment_1.default().format('DD/MM/YYYY');
        var days = [];
        for (var i = 0; i < 7 * 6; i += 1) {
            days.push({
                day: monthMoment.date(),
                month: monthMoment.month() + 1,
                year: monthMoment.year(),
                today: today === monthMoment.format('DD/MM/YYYY'),
                date: monthMoment.format('DD/MM/YYYY'),
                dateInstance: monthMoment.toDate(),
                dateYYYYMMDD: monthMoment.format('YYYYMMDD'),
                lastMonth: previousMonth === monthMoment.month(),
                currentMonth: currentMonth === monthMoment.month(),
                nextMonth: nextMonth === monthMoment.month(),
            });
            monthMoment.add(1, 'day');
        }
        return _.chunk(days, 7);
    };
    return CalendarService;
}());
exports.Calendar = new CalendarService();
//# sourceMappingURL=calendar.service.js.map