import { __extends } from "tslib";
import * as React from 'react';
import { Calendar, DayOfWeek, defaultDayPickerStrings, DateRangeType } from '@uifabric/date-time';
import * as styles from './Calendar.Example.scss';
var CalendarInlineMonthOnlyExample = /** @class */ (function (_super) {
    __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(Calendar, { dateRangeType: DateRangeType.Month, showGoToToday: true, highlightCurrentMonth: false, highlightSelectedMonth: true, isDayPickerVisible: false, onSelectDate: this._onSelectDate, value: this.state.selectedDate, firstDayOfWeek: DayOfWeek.Sunday, strings: defaultDayPickerStrings })));
    };
    return CalendarInlineMonthOnlyExample;
}(React.Component));
export { CalendarInlineMonthOnlyExample };
//# sourceMappingURL=Calendar.Inline.MonthOnly.Example.js.map