"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var date_time_utilities_1 = require("@fluentui/date-time-utilities");
var date_time_1 = require("@uifabric/date-time");
var styles = require("./Calendar.Example.scss");
var today = new Date();
var minDate = date_time_utilities_1.addMonths(today, -1);
var maxDate = date_time_utilities_1.addYears(today, 1);
var restrictedDates = [date_time_utilities_1.addDays(today, -2), date_time_utilities_1.addDays(today, -8), date_time_utilities_1.addDays(today, 2), date_time_utilities_1.addDays(today, 8)];
var CalendarInlineDateBoundariesExample = /** @class */ (function (_super) {
    tslib_1.__extends(CalendarInlineDateBoundariesExample, _super);
    function CalendarInlineDateBoundariesExample(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: today,
        };
        return _this;
    }
    CalendarInlineDateBoundariesExample.prototype.render = function () {
        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())),
            (minDate || maxDate) && (React.createElement("div", null,
                "Date boundary:",
                React.createElement("span", null,
                    ' ',
                    minDate ? minDate.toLocaleDateString() : 'Not set',
                    "-",
                    maxDate ? maxDate.toLocaleDateString() : 'Not set'))),
            restrictedDates && (React.createElement("div", null,
                "Disabled date(s):",
                React.createElement("span", null,
                    ' ',
                    restrictedDates.length > 0
                        ? restrictedDates.map(function (d) { return d.toLocaleDateString(); }).join(', ')
                        : 'Not set'))),
            React.createElement(date_time_1.Calendar, { dateRangeType: date_time_1.DateRangeType.Day, highlightCurrentMonth: false, highlightSelectedMonth: true, showGoToToday: false, minDate: minDate, maxDate: maxDate, restrictedDates: restrictedDates, onSelectDate: this._onSelectDate, value: this.state.selectedDate, firstDayOfWeek: date_time_1.DayOfWeek.Sunday, strings: date_time_1.defaultDayPickerStrings })));
    };
    return CalendarInlineDateBoundariesExample;
}(React.Component));
exports.CalendarInlineDateBoundariesExample = CalendarInlineDateBoundariesExample;
//# sourceMappingURL=Calendar.Inline.DateBoundaries.Example.js.map