Liferay.Loader.define("segments-web@3.0.68/js/components/inputs/DateTimeInput.es",["module","exports","require","segments-web$date-fns","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../utils/constants.es"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=l(a("segments-web$date-fns")),s=(l(a("liferay!frontend-js-react-web$prop-types")),l(a("liferay!frontend-js-react-web$react"))),r=a("../../utils/constants.es");function l(e){return e&&e.__esModule?e:{default:e}}function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const e="YYYY-MM-DD";class o extends s.default.Component{constructor(...t){super(...t),i(this,"state",{}),i(this,"_handleDateChange",(e=>{const t=e.target.value;this.setState({value:t})})),i(this,"_handleDateBlur",(t=>{const a=n.default.format(t.target.value,e);if("Invalid Date"!==a)this.setState({value:a},(()=>{this.props.onChange({type:r.PROPERTY_TYPES.DATE_TIME,value:n.default.parse(a,e).toISOString()})}));else{const t=n.default.format(new Date,e);this.setState({value:t},(()=>{this.props.onChange({type:r.PROPERTY_TYPES.DATE_TIME,value:n.default.parse(t,e).toISOString()})}))}}))}static getDerivedStateFromProps(t,a){let s=null;return t.value!==a.initialValue&&(s={initialValue:t.value,value:n.default.format(new Date(t.value),e)}),s}render(){const{value:e}=this.state,{disabled:t}=this.props;return s.default.createElement("div",{className:"criterion-input date-input"},s.default.createElement("input",{className:"form-control","data-testid":"date-input",disabled:t,onBlur:this._handleDateBlur,onChange:this._handleDateChange,type:"date",value:e}))}}var u=o;t.default=u}}));
//# sourceMappingURL=DateTimeInput.es.js.map