"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var date_time_1 = require("@uifabric/date-time");
var styles = require("./Calendar.Example.scss");
var CalendarInlineMonthOnlyExample = /** @class */ (function (_super) {
    tslib_1.__extends(CalendarInlineMonthOnlyExample, _super);
    function CalendarInlineMonthOnlyExample(props) {
        var _this = _super.call(this, props) || this;
        _this._onSelectDate = function (date, dateRangeArray) {
            _this.setState(function (prevState) {
                return {
                    selectedDate: date,
                    selectedDateRange: dateRangeArray,
                };
            });
        };
        _this.state = {
            selectedDate: new Date(),
            selectedDateRange: undefined,
        };
        return _this;
    }
    CalendarInlineMonthOnlyExample.prototype.render = function () {
        var dateRangeString = null;
        if (this.state.selectedDateRange) {
            var rangeStart = this.state.selectedDateRange[0];
            var rangeEnd = this.state.selectedDateRange[this.state.selectedDateRange.length - 1];
            dateRangeString = rangeStart.toLocaleDateString() + '-' + rangeEnd.toLocaleDateString();
        }
        return (React.createElement("div", { className: styles.wrapper },
            React.createElement("div", null,
                "Selected date(s):",
                ' ',
                React.createElement("span", null, !this.state.selectedDate ? 'Not set' : this.state.selectedDate.toLocaleString())),
            React.createElement("div", null,
                "Selected dates:",
                React.createElement("span", null,
                    " ",
                    !dateRangeString ? 'Not set' : dateRangeString)),
            React.createElement(date_time_1.Calendar, { dateRangeType: date_time_1.DateRangeType.Month, showGoToToday: true, highlightCurrentMonth: false, highlightSelectedMonth: true, isDayPickerVisible: false, onSelectDate: this._onSelectDate, value: this.state.selectedDate, firstDayOfWeek: date_time_1.DayOfWeek.Sunday, strings: date_time_1.defaultDayPickerStrings })));
    };
    return CalendarInlineMonthOnlyExample;
}(React.Component));
exports.CalendarInlineMonthOnlyExample = CalendarInlineMonthOnlyExample;
//# sourceMappingURL=Calendar.Inline.MonthOnly.Example.js.map