import { __extends } from "tslib";
import * as React from 'react';
import { addMonths, addYears, addDays } from '@fluentui/date-time-utilities';
import { Calendar, DateRangeType, DayOfWeek, defaultDayPickerStrings } from '@uifabric/date-time';
import * as styles from './Calendar.Example.scss';
var today = new Date();
var minDate = addMonths(today, -1);
var maxDate = addYears(today, 1);
var restrictedDates = [addDays(today, -2), addDays(today, -8), addDays(today, 2), addDays(today, 8)];
var CalendarInlineDateBoundariesExample = /** @class */ (function (_super) {
    __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(Calendar, { dateRangeType: DateRangeType.Day, highlightCurrentMonth: false, highlightSelectedMonth: true, showGoToToday: false, minDate: minDate, maxDate: maxDate, restrictedDates: restrictedDates, onSelectDate: this._onSelectDate, value: this.state.selectedDate, firstDayOfWeek: DayOfWeek.Sunday, strings: defaultDayPickerStrings })));
    };
    return CalendarInlineDateBoundariesExample;
}(React.Component));
export { CalendarInlineDateBoundariesExample };
//# sourceMappingURL=Calendar.Inline.DateBoundaries.Example.js.map