"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatePickerBoundedExample = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var react_1 = require("@fluentui/react");
var react_hooks_1 = require("@fluentui/react-hooks");
var datePickerStyles = { root: { maxWidth: 300, marginTop: 15 } };
var DatePickerBoundedExample = function () {
    var today = react_hooks_1.useConst(new Date(Date.now()));
    var minDate = react_hooks_1.useConst(react_1.addMonths(today, -1));
    var maxDate = react_hooks_1.useConst(react_1.addYears(today, 1));
    var strings = react_hooks_1.useConst(function () { return (tslib_1.__assign(tslib_1.__assign({}, react_1.defaultDatePickerStrings), { 
        // eslint-disable-next-line @fluentui/max-len
        isOutOfBoundsErrorMessage: "Date must be between " + minDate.toLocaleDateString() + " and " + maxDate.toLocaleDateString() })); });
    return (React.createElement("div", null,
        React.createElement("div", null,
            "When date boundaries are set (via ",
            React.createElement("code", null, "minDate"),
            " and ",
            React.createElement("code", null, "maxDate"),
            " props) the DatePicker will not allow out-of-bounds dates to be picked or entered. In this example, the allowed dates are",
            ' ',
            minDate.toLocaleDateString(),
            " to ",
            maxDate.toLocaleDateString(),
            "."),
        React.createElement(react_1.DatePicker, { styles: datePickerStyles, strings: strings, placeholder: "Select a date...", ariaLabel: "Select a date", minDate: minDate, maxDate: maxDate, allowTextInput: true })));
};
exports.DatePickerBoundedExample = DatePickerBoundedExample;
//# sourceMappingURL=DatePicker.Bounded.Example.js.map