From 53a6071942430e6a7bc836db9d318746ada26112 Mon Sep 17 00:00:00 2001 From: Brendan Date: Wed, 26 Oct 2022 15:39:34 -0700 Subject: [PATCH] Add timeCountersFormat prop --- dist/react-datetime.cjs.js | 2 +- dist/react-datetime.cjs.js.map | 2 +- dist/react-datetime.umd.js | 2 +- dist/react-datetime.umd.js.map | 2 +- package.json | 2 +- react-datetime.d.ts | 6 ++++++ src/DateTime.js | 1 + src/playground/App.js | 2 ++ src/views/TimeView.js | 2 +- typings/DateTime.d.ts | 7 +++++++ 10 files changed, 22 insertions(+), 6 deletions(-) diff --git a/dist/react-datetime.cjs.js b/dist/react-datetime.cjs.js index ba257eb96..29ecf2a36 100644 --- a/dist/react-datetime.cjs.js +++ b/dist/react-datetime.cjs.js @@ -1,2 +1,2 @@ -module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("moment")},function(e,t){e.exports=require("moment-timezone")},function(e,t){e.exports=require("react-dom")},function(e,t,n){e.exports=n(6)()},function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";var r=n(7);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),a=n(1),i=n.n(a),s=n(0),c=n.n(s);function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t1;)if(t(n.date(r)))return!1;return!0}},{key:"getMonthText",value:function(e){var t,n=this.props.viewDate,r=n.localeData().monthsShort(n.month(e));return(t=r.substring(0,3)).charAt(0).toUpperCase()+t.slice(1)}}])&&C(t.prototype,n),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(c.a.Component);function N(e,t){return t<4?e[0]:t<8?e[1]:e[2]}function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var n=0;n1;)if(n(r.dayOfYear(o)))return t[e]=!1,!1;return t[e]=!0,!0}}])&&F(t.prototype,n),r&&F(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(c.a.Component);function H(e,t){return t<3?e[0]:t<7?e[1]:e[2]}B(Z,"defaultProps",{renderYear:function(e,t){return c.a.createElement("td",e,t)}});var U=n(2),z=n.n(U);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=r&&t<=o&&n(t)}),[n,o,r,u]);return c.a.createElement("input",{value:i,onChange:f,className:"rdtInput ".concat(l&&"invalid")})},ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K(e,t)}(a,e);var t,n,r,o=G(a);function a(e){var t,n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=o.call(this,e)).constraints=(n=e.timeConstraints,r={},Object.keys(re).forEach((function(e){r[e]=te(te({},re[e]),n[e]||{})})),r),t.state=t.getTimeParts(e.selectedDate||e.viewDate),t}return t=a,(n=[{key:"render",value:function(){var e=this,t=[],n=this.state;return this.getCounters().forEach((function(r,o){o&&"ampm"!==r&&t.push(c.a.createElement("div",{key:"sep".concat(o),className:"rdtCounterSeparator"},":")),t.push(e.renderCounter(r,n[r]))})),c.a.createElement("div",{className:"rdtTime"},c.a.createElement("table",null,this.renderHeader(),c.a.createElement("tbody",null,c.a.createElement("tr",null,c.a.createElement("td",null,c.a.createElement("div",{className:"rdtCounters"},t)))),this.props.showTimeZone&&c.a.createElement("div",{className:"timezone-display"},c.a.createElement("span",null,"(GMT",z.a.tz(this.props.displayTimeZone||z.a.tz.guess()).format("Z"),")"),c.a.createElement("span",null," "),c.a.createElement("span",null,this.props.displayTimeZone||z.a.tz.guess()))))}},{key:"setNumber",value:function(e,t){this.props.setTime(t,parseInt(e,10))}},{key:"renderCounter",value:function(e,t){var n=this;return"hours"===e&&this.isAMPM()&&0==(t=(t-1)%12+1)&&(t=12),"ampm"===e&&(t=-1!==this.props.timeFormat.indexOf(" A")?this.props.viewDate.format("A"):this.props.viewDate.format("a")),c.a.createElement("div",{key:e,className:"rdtCounter"},c.a.createElement("span",{className:"rdtBtn",onMouseDown:function(t){return n.onStartClicking(t,"increase",e)}},"▲"),c.a.createElement("div",{className:"rdtCount"},"ampm"!==e?c.a.createElement(oe,{value:t,onChange:function(t){return n.setNumber(t,e)},min:re[e].min,max:re[e].max}):t),c.a.createElement("span",{className:"rdtBtn",onMouseDown:function(t){return n.onStartClicking(t,"decrease",e)}},"▼"))}},{key:"renderHeader",value:function(){var e=this;if(this.props.dateFormat){var t=this.props.selectedDate||this.props.viewDate;return c.a.createElement("thead",null,c.a.createElement("tr",null,c.a.createElement("td",{className:"rdtSwitch",colSpan:"4",onClick:function(){return e.props.showView("days")}},t.format(this.props.dateFormat))))}}},{key:"onStartClicking",value:function(e,t,n){var r=this;if(!e||!e.button||0===e.button){if("ampm"===n)return this.toggleDayPart();var o={},a=document.body;o[n]=this[t](n),this.setState(o),this.timer=setTimeout((function(){r.increaseTimer=setInterval((function(){o[n]=r[t](n),r.setState(o)}),70)}),500),this.mouseUpListener=function(){clearTimeout(r.timer),clearInterval(r.increaseTimer),r.props.setTime(n,parseInt(r.state[n],10)),a.removeEventListener("mouseup",r.mouseUpListener),a.removeEventListener("touchend",r.mouseUpListener)},a.addEventListener("mouseup",this.mouseUpListener),a.addEventListener("touchend",this.mouseUpListener)}}},{key:"toggleDayPart",value:function(){var e=parseInt(this.state.hours,10);e>=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)+t.step;return n>t.max&&(n=t.min+(n-(t.max+1))),ie(e,n)}},{key:"decrease",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)-t.step;return n=0||(o[n]=e[n]);return o}(t,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(s.createElement)(e,n)},i}(s.Component),n.displayName="OnClickOutside("+o+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r};function ge(e){return(ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function we(e){for(var t=1;t0?r.props.onNavigateForward(e,t):r.props.onNavigateBack(-e,t),r.setState({viewDate:n})})),Ve(Se(r),"_setTime",(function(e,t){var n=(r.getSelectedDate()||r.state.viewDate).clone();n[e](t),r.props.value||r.setState({selectedDate:n,viewDate:n.clone(),inputValue:n.format(r.getFormat("datetime"))}),r.props.onChange(n)})),Ve(Se(r),"_openCalendar",(function(){r.isOpen()||r.setState({open:!0},r.props.onOpen)})),Ve(Se(r),"_closeCalendar",(function(){r.isOpen()&&r.setState({open:!1},(function(){r.props.onClose(r.state.selectedDate||r.state.inputValue)}))})),Ve(Se(r),"_handleClickOutside",(function(){var e=r.props;e.input&&r.state.open&&void 0===e.open&&e.closeOnClickOutside&&r._closeCalendar()})),Ve(Se(r),"_onInputFocus",(function(e){r.callHandler(r.props.inputProps.onFocus,e)&&r._openCalendar()})),Ve(Se(r),"_onInputChange",(function(e){if(r.callHandler(r.props.inputProps.onChange,e)){var t=e.target?e.target.value:e,n=r.localMoment(t,r.getFormat("datetime")),o={inputValue:t};n.isValid()?(o.selectedDate=n,o.viewDate=n.clone().startOf("month")):o.selectedDate=null,r.setState(o,(function(){r.props.onChange(n.isValid()?n:r.state.inputValue)}))}})),Ve(Se(r),"_onInputKeyDown",(function(e){r.callHandler(r.props.inputProps.onKeyDown,e)&&9===e.which&&r.props.closeOnTab&&r._closeCalendar()})),Ve(Se(r),"_onInputClick",(function(e){r.callHandler(r.props.inputProps.onClick,e)&&r._openCalendar()})),r.state=r.getInitialState(),r}return Ce(n,[{key:"render",value:function(){return c.a.createElement(Be,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),c.a.createElement("div",{className:"rdtPicker"},this.renderView()))}},{key:"renderInput",value:function(){if(this.props.input){var e=we(we({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?c.a.createElement("div",null,this.props.renderInput(e,this._openCalendar,this._closeCalendar)):c.a.createElement("input",e)}}},{key:"renderView",value:function(){return this.props.renderView(this.state.currentView,this._renderCalendar)}},{key:"getInitialState",value:function(){var e=this.props,t=this.getFormat("datetime"),n=this.parseDate(e.value||e.initialValue,t);return this.checkTZ(),{open:!e.input,currentView:e.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(n),selectedDate:n&&n.isValid()?n:void 0,inputValue:this.getInitialInputValue(n)}}},{key:"getInitialViewDate",value:function(e){var t,n=this.props.initialViewDate;if(n){if((t=this.parseDate(n,this.getFormat("datetime")))&&t.isValid())return t;Le('The initialViewDated given "'+n+'" is not valid. Using current date instead.')}else if(e&&e.isValid())return e.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var e=this.localMoment();return e.hour(0).minute(0).second(0).millisecond(0),e}},{key:"getInitialView",value:function(){var e=this.getFormat("date");return e?this.getUpdateOn(e):Fe}},{key:"parseDate",value:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n}},{key:"getClassName",value:function(){var e="rdt",t=this.props,n=t.className;return Array.isArray(n)?e+=" "+n.join(" "):n&&(e+=" "+n),t.input||(e+=" rdtStatic"),this.isOpen()&&(e+=" rdtOpen"),e}},{key:"isOpen",value:function(){return!this.props.input||(void 0===this.props.open?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(e){return this.props.updateOnView?this.props.updateOnView:e.match(/[lLD]/)?Ie:-1!==e.indexOf("M")?xe:-1!==e.indexOf("Y")?Ne:Ie}},{key:"getLocaleData",value:function(){var e=this.props;return this.localMoment(e.value||e.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(){var e=this.getLocaleData(),t=this.props.dateFormat;return!0===t?e.longDateFormat("L"):t||""}},{key:"getTimeFormat",value:function(){var e=this.getLocaleData(),t=this.props.timeFormat;return!0===t?e.longDateFormat("LT"):t||""}},{key:"getFormat",value:function(e){if("date"===e)return this.getDateFormat();if("time"===e)return this.getTimeFormat();var t=this.getDateFormat(),n=this.getTimeFormat(),r=this.props.showTimeFirst?"".concat(n," ").concat(t):"".concat(t," ").concat(n);return t&&n?r:t||n}},{key:"updateTime",value:function(e,t,n,r){var o={},a=r?"selectedDate":"viewDate";o[a]=this.state[a].clone()[e](t,n),this.setState(o)}},{key:"localMoment",value:function(e,t,n){var r=null;return r=(n=n||this.props).utc?i.a.utc(e,t,n.strictParsing):n.displayTimeZone?i.a.tz(e,t,n.displayTimeZone):i()(e,t,n.strictParsing),n.locale&&r.locale(n.locale),r}},{key:"checkTZ",value:function(){var e=this.props.displayTimeZone;!e||this.tzWarning||i.a.tz||(this.tzWarning=!0,Le('displayTimeZone prop with value "'+e+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(e){if(e!==this.props){var t=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach((function(r){e[r]!==n[r]&&(t=!0)})),t&&this.regenerateDates(),n.value&&n.value!==e.value&&this.setViewDate(n.value),this.checkTZ()}}},{key:"regenerateDates",value:function(){var e=this.props,t=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();e.locale&&(t.locale(e.locale),n&&n.locale(e.locale)),e.utc?(t.utc(),n&&n.utc()):e.displayTimeZone?(t.tz(e.displayTimeZone),n&&n.tz(e.displayTimeZone)):(t.locale(),n&&n.locale());var r={viewDate:t,selectedDate:n};n&&n.isValid()&&(r.inputValue=n.format(this.getFormat("datetime"))),this.setState(r)}},{key:"getSelectedDate",value:function(){if(void 0===this.props.value)return this.state.selectedDate;var e=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!e||!e.isValid())&&e}},{key:"getInitialInputValue",value:function(e){var t=this.props;return t.inputProps.value?t.inputProps.value:e&&e.isValid()?e.format(this.getFormat("datetime")):t.value&&"string"==typeof t.value?t.value:t.initialValue&&"string"==typeof t.initialValue?t.initialValue:""}},{key:"getInputValue",value:function(){return this.state.inputValue}},{key:"setViewDate",value:function(e){var t,n=function(){return Le("Invalid date passed to the `setViewDate` method: "+e)};if(!e)return n();if(!(t="string"==typeof e?this.localMoment(e,this.getFormat("datetime")):this.localMoment(e))||!t.isValid())return n();var r=this.getSelectedDate();this.setState({viewDate:t,inputValue:r?r.format(this.getFormat("datetime")):this.state.inputValue})}},{key:"navigate",value:function(e){this._showView(e)}},{key:"callHandler",value:function(e,t){return!e||!1!==e(t)}}]),n}(c.a.Component);function Le(e,t){var n="undefined"!=typeof window&&window.console;n&&(t||(t="warn"),n[t]("***react-datetime:"+e))}Ve(Ae,"propTypes",{value:Ye,initialValue:Ye,initialViewDate:Ye,initialViewMode:Me.oneOf([Ne,xe,Ie,Fe]),onOpen:Me.func,onClose:Me.func,onChange:Me.func,onNavigate:Me.func,onBeforeNavigate:Me.func,onNavigateBack:Me.func,onNavigateForward:Me.func,updateOnView:Me.string,locale:Me.string,utc:Me.bool,displayTimeZone:Me.string,input:Me.bool,displayTimeFirst:Me.bool,showTimeZone:Me.bool,dateFormat:Me.oneOfType([Me.string,Me.bool]),timeFormat:Me.oneOfType([Me.string,Me.bool]),inputProps:Me.object,timeConstraints:Me.object,isValidDate:Me.func,open:Me.bool,strictParsing:Me.bool,closeOnSelect:Me.bool,closeOnTab:Me.bool,renderView:Me.func,renderInput:Me.func,renderDay:Me.func,renderMonth:Me.func,renderYear:Me.func}),Ve(Ae,"defaultProps",{onOpen:Re,onClose:Re,onCalendarOpen:Re,onCalendarClose:Re,onChange:Re,onNavigate:Re,onBeforeNavigate:function(e){return e},onNavigateBack:Re,onNavigateForward:Re,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:function(e,t){return t()}}),Ve(Ae,"moment",i.a);var Be=be(function(e){Pe(n,e);var t=Ee(n);function n(){var e;De(this,n);for(var r=arguments.length,o=new Array(r),a=0;a1;)if(t(n.date(r)))return!1;return!0}},{key:"getMonthText",value:function(e){var t,n=this.props.viewDate,r=n.localeData().monthsShort(n.month(e));return(t=r.substring(0,3)).charAt(0).toUpperCase()+t.slice(1)}}])&&C(t.prototype,n),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(c.a.Component);function N(e,t){return t<4?e[0]:t<8?e[1]:e[2]}function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var n=0;n1;)if(n(r.dayOfYear(o)))return t[e]=!1,!1;return t[e]=!0,!0}}])&&F(t.prototype,n),r&&F(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(c.a.Component);function H(e,t){return t<3?e[0]:t<7?e[1]:e[2]}B(Z,"defaultProps",{renderYear:function(e,t){return c.a.createElement("td",e,t)}});var U=n(2),z=n.n(U);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=r&&t<=o&&n(t)}),[n,o,r,u]);return c.a.createElement("input",{value:i,onChange:f,className:"rdtInput ".concat(l&&"invalid")})},ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K(e,t)}(a,e);var t,n,r,o=G(a);function a(e){var t,n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=o.call(this,e)).constraints=(n=e.timeConstraints,r={},Object.keys(re).forEach((function(e){r[e]=te(te({},re[e]),n[e]||{})})),r),t.state=t.getTimeParts(e.selectedDate||e.viewDate),t}return t=a,(n=[{key:"render",value:function(){var e=this,t=[],n=this.state;return this.getCounters().forEach((function(r,o){o&&"ampm"!==r&&t.push(c.a.createElement("div",{key:"sep".concat(o),className:"rdtCounterSeparator"},":")),t.push(e.renderCounter(r,n[r]))})),c.a.createElement("div",{className:"rdtTime"},c.a.createElement("table",null,this.renderHeader(),c.a.createElement("tbody",null,c.a.createElement("tr",null,c.a.createElement("td",null,c.a.createElement("div",{className:"rdtCounters"},t)))),this.props.showTimeZone&&c.a.createElement("div",{className:"timezone-display"},c.a.createElement("span",null,"(GMT",z.a.tz(this.props.displayTimeZone||z.a.tz.guess()).format("Z"),")"),c.a.createElement("span",null," "),c.a.createElement("span",null,this.props.displayTimeZone||z.a.tz.guess()))))}},{key:"setNumber",value:function(e,t){this.props.setTime(t,parseInt(e,10))}},{key:"renderCounter",value:function(e,t){var n=this;return"hours"===e&&this.isAMPM()&&0==(t=(t-1)%12+1)&&(t=12),"ampm"===e&&(t=-1!==this.props.timeFormat.indexOf(" A")?this.props.viewDate.format("A"):this.props.viewDate.format("a")),c.a.createElement("div",{key:e,className:"rdtCounter"},c.a.createElement("span",{className:"rdtBtn",onMouseDown:function(t){return n.onStartClicking(t,"increase",e)}},"▲"),c.a.createElement("div",{className:"rdtCount"},"ampm"!==e?c.a.createElement(oe,{value:t,onChange:function(t){return n.setNumber(t,e)},min:re[e].min,max:re[e].max}):t),c.a.createElement("span",{className:"rdtBtn",onMouseDown:function(t){return n.onStartClicking(t,"decrease",e)}},"▼"))}},{key:"renderHeader",value:function(){var e=this;if(this.props.dateFormat){var t=this.props.selectedDate||this.props.viewDate;return c.a.createElement("thead",null,c.a.createElement("tr",null,c.a.createElement("td",{className:"rdtSwitch",colSpan:"4",onClick:function(){return e.props.showView("days")}},t.format(this.props.dateFormat))))}}},{key:"onStartClicking",value:function(e,t,n){var r=this;if(!e||!e.button||0===e.button){if("ampm"===n)return this.toggleDayPart();var o={},a=document.body;o[n]=this[t](n),this.setState(o),this.timer=setTimeout((function(){r.increaseTimer=setInterval((function(){o[n]=r[t](n),r.setState(o)}),70)}),500),this.mouseUpListener=function(){clearTimeout(r.timer),clearInterval(r.increaseTimer),r.props.setTime(n,parseInt(r.state[n],10)),a.removeEventListener("mouseup",r.mouseUpListener),a.removeEventListener("touchend",r.mouseUpListener)},a.addEventListener("mouseup",this.mouseUpListener),a.addEventListener("touchend",this.mouseUpListener)}}},{key:"toggleDayPart",value:function(){var e=parseInt(this.state.hours,10);e>=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)+t.step;return n>t.max&&(n=t.min+(n-(t.max+1))),ie(e,n)}},{key:"decrease",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)-t.step;return n=0||(o[n]=e[n]);return o}(t,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(s.createElement)(e,n)},i}(s.Component),n.displayName="OnClickOutside("+o+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r};function ge(e){return(ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function we(e){for(var t=1;t0?r.props.onNavigateForward(e,t):r.props.onNavigateBack(-e,t),r.setState({viewDate:n})})),Ve(Se(r),"_setTime",(function(e,t){var n=(r.getSelectedDate()||r.state.viewDate).clone();n[e](t),r.props.value||r.setState({selectedDate:n,viewDate:n.clone(),inputValue:n.format(r.getFormat("datetime"))}),r.props.onChange(n)})),Ve(Se(r),"_openCalendar",(function(){r.isOpen()||r.setState({open:!0},r.props.onOpen)})),Ve(Se(r),"_closeCalendar",(function(){r.isOpen()&&r.setState({open:!1},(function(){r.props.onClose(r.state.selectedDate||r.state.inputValue)}))})),Ve(Se(r),"_handleClickOutside",(function(){var e=r.props;e.input&&r.state.open&&void 0===e.open&&e.closeOnClickOutside&&r._closeCalendar()})),Ve(Se(r),"_onInputFocus",(function(e){r.callHandler(r.props.inputProps.onFocus,e)&&r._openCalendar()})),Ve(Se(r),"_onInputChange",(function(e){if(r.callHandler(r.props.inputProps.onChange,e)){var t=e.target?e.target.value:e,n=r.localMoment(t,r.getFormat("datetime")),o={inputValue:t};n.isValid()?(o.selectedDate=n,o.viewDate=n.clone().startOf("month")):o.selectedDate=null,r.setState(o,(function(){r.props.onChange(n.isValid()?n:r.state.inputValue)}))}})),Ve(Se(r),"_onInputKeyDown",(function(e){r.callHandler(r.props.inputProps.onKeyDown,e)&&9===e.which&&r.props.closeOnTab&&r._closeCalendar()})),Ve(Se(r),"_onInputClick",(function(e){r.callHandler(r.props.inputProps.onClick,e)&&r._openCalendar()})),r.state=r.getInitialState(),r}return Ce(n,[{key:"render",value:function(){return c.a.createElement(Be,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),c.a.createElement("div",{className:"rdtPicker"},this.renderView()))}},{key:"renderInput",value:function(){if(this.props.input){var e=we(we({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?c.a.createElement("div",null,this.props.renderInput(e,this._openCalendar,this._closeCalendar)):c.a.createElement("input",e)}}},{key:"renderView",value:function(){return this.props.renderView(this.state.currentView,this._renderCalendar)}},{key:"getInitialState",value:function(){var e=this.props,t=this.getFormat("datetime"),n=this.parseDate(e.value||e.initialValue,t);return this.checkTZ(),{open:!e.input,currentView:e.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(n),selectedDate:n&&n.isValid()?n:void 0,inputValue:this.getInitialInputValue(n)}}},{key:"getInitialViewDate",value:function(e){var t,n=this.props.initialViewDate;if(n){if((t=this.parseDate(n,this.getFormat("datetime")))&&t.isValid())return t;Le('The initialViewDated given "'+n+'" is not valid. Using current date instead.')}else if(e&&e.isValid())return e.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var e=this.localMoment();return e.hour(0).minute(0).second(0).millisecond(0),e}},{key:"getInitialView",value:function(){var e=this.getFormat("date");return e?this.getUpdateOn(e):Fe}},{key:"parseDate",value:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n}},{key:"getClassName",value:function(){var e="rdt",t=this.props,n=t.className;return Array.isArray(n)?e+=" "+n.join(" "):n&&(e+=" "+n),t.input||(e+=" rdtStatic"),this.isOpen()&&(e+=" rdtOpen"),e}},{key:"isOpen",value:function(){return!this.props.input||(void 0===this.props.open?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(e){return this.props.updateOnView?this.props.updateOnView:e.match(/[lLD]/)?Ie:-1!==e.indexOf("M")?xe:-1!==e.indexOf("Y")?Ne:Ie}},{key:"getLocaleData",value:function(){var e=this.props;return this.localMoment(e.value||e.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(){var e=this.getLocaleData(),t=this.props.dateFormat;return!0===t?e.longDateFormat("L"):t||""}},{key:"getTimeFormat",value:function(){var e=this.getLocaleData(),t=this.props.timeFormat;return!0===t?e.longDateFormat("LT"):t||""}},{key:"getFormat",value:function(e){if("date"===e)return this.getDateFormat();if("time"===e)return this.getTimeFormat();var t=this.getDateFormat(),n=this.getTimeFormat(),r=this.props.showTimeFirst?"".concat(n," ").concat(t):"".concat(t," ").concat(n);return t&&n?r:t||n}},{key:"updateTime",value:function(e,t,n,r){var o={},a=r?"selectedDate":"viewDate";o[a]=this.state[a].clone()[e](t,n),this.setState(o)}},{key:"localMoment",value:function(e,t,n){var r=null;return r=(n=n||this.props).utc?i.a.utc(e,t,n.strictParsing):n.displayTimeZone?i.a.tz(e,t,n.displayTimeZone):i()(e,t,n.strictParsing),n.locale&&r.locale(n.locale),r}},{key:"checkTZ",value:function(){var e=this.props.displayTimeZone;!e||this.tzWarning||i.a.tz||(this.tzWarning=!0,Le('displayTimeZone prop with value "'+e+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(e){if(e!==this.props){var t=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach((function(r){e[r]!==n[r]&&(t=!0)})),t&&this.regenerateDates(),n.value&&n.value!==e.value&&this.setViewDate(n.value),this.checkTZ()}}},{key:"regenerateDates",value:function(){var e=this.props,t=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();e.locale&&(t.locale(e.locale),n&&n.locale(e.locale)),e.utc?(t.utc(),n&&n.utc()):e.displayTimeZone?(t.tz(e.displayTimeZone),n&&n.tz(e.displayTimeZone)):(t.locale(),n&&n.locale());var r={viewDate:t,selectedDate:n};n&&n.isValid()&&(r.inputValue=n.format(this.getFormat("datetime"))),this.setState(r)}},{key:"getSelectedDate",value:function(){if(void 0===this.props.value)return this.state.selectedDate;var e=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!e||!e.isValid())&&e}},{key:"getInitialInputValue",value:function(e){var t=this.props;return t.inputProps.value?t.inputProps.value:e&&e.isValid()?e.format(this.getFormat("datetime")):t.value&&"string"==typeof t.value?t.value:t.initialValue&&"string"==typeof t.initialValue?t.initialValue:""}},{key:"getInputValue",value:function(){return this.state.inputValue}},{key:"setViewDate",value:function(e){var t,n=function(){return Le("Invalid date passed to the `setViewDate` method: "+e)};if(!e)return n();if(!(t="string"==typeof e?this.localMoment(e,this.getFormat("datetime")):this.localMoment(e))||!t.isValid())return n();var r=this.getSelectedDate();this.setState({viewDate:t,inputValue:r?r.format(this.getFormat("datetime")):this.state.inputValue})}},{key:"navigate",value:function(e){this._showView(e)}},{key:"callHandler",value:function(e,t){return!e||!1!==e(t)}}]),n}(c.a.Component);function Le(e,t){var n="undefined"!=typeof window&&window.console;n&&(t||(t="warn"),n[t]("***react-datetime:"+e))}Ve(Ae,"propTypes",{value:Ye,initialValue:Ye,initialViewDate:Ye,initialViewMode:Me.oneOf([Ne,xe,Ie,Fe]),onOpen:Me.func,onClose:Me.func,onChange:Me.func,onNavigate:Me.func,onBeforeNavigate:Me.func,onNavigateBack:Me.func,onNavigateForward:Me.func,updateOnView:Me.string,locale:Me.string,utc:Me.bool,displayTimeZone:Me.string,input:Me.bool,displayTimeFirst:Me.bool,showTimeZone:Me.bool,dateFormat:Me.oneOfType([Me.string,Me.bool]),timeFormat:Me.oneOfType([Me.string,Me.bool]),inputProps:Me.object,timeConstraints:Me.object,isValidDate:Me.func,open:Me.bool,strictParsing:Me.bool,closeOnSelect:Me.bool,closeOnTab:Me.bool,renderView:Me.func,renderInput:Me.func,renderDay:Me.func,renderMonth:Me.func,renderYear:Me.func}),Ve(Ae,"defaultProps",{onOpen:Re,onClose:Re,onCalendarOpen:Re,onCalendarClose:Re,onChange:Re,onNavigate:Re,onBeforeNavigate:function(e){return e},onNavigateBack:Re,onNavigateForward:Re,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:function(e,t){return t()}}),Ve(Ae,"moment",i.a);var Be=be(function(e){Pe(n,e);var t=Ee(n);function n(){var e;De(this,n);for(var r=arguments.length,o=new Array(r),a=0;a\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{ switchContent }\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class DaysView extends React.Component {\n\tstatic defaultProps = {\n\t\tisValidDate: () => true,\n\t\trenderDay: ( props, date ) => { date.date() },\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\t{ this.renderDayHeaders() }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderDays() }\n\t\t\t\t\t\n\t\t\t\t\t{ this.renderFooter() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst date = this.props.viewDate;\n\t\tconst locale = date.localeData();\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'months' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'months' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'months' ) }\n\t\t\t\tswitchContent={ locale.months( date ) + ' ' + date.year() }\n\t\t\t\tswitchColSpan={5}\n\t\t\t\tswitchProps={ { 'data-value': this.props.viewDate.month() } }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderDayHeaders() {\n\t\tconst locale = this.props.viewDate.localeData();\n\t\tlet dayItems = getDaysOfWeek( locale ).map( (day, index) => (\n\t\t\t{ day }\n\t\t));\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ dayItems }\n\t\t\t\n\t\t);\n\t}\n\n\trenderDays() {\n\t\tconst date = this.props.viewDate;\n\t\tconst startOfMonth = date.clone().startOf('month');\n\t\tconst endOfMonth = date.clone().endOf('month');\n\n\t\t// We need 42 days in 6 rows\n\t\t// starting in the last week of the previous month\n\t\tlet rows = [[], [], [], [], [], []];\n\n\t\tlet startDate = date.clone().subtract( 1, 'months');\n\t\tstartDate.date( startDate.daysInMonth() ).startOf('week');\n\n\t\tlet endDate = startDate.clone().add( 42, 'd' );\n\t\tlet i = 0;\n\n\t\twhile ( startDate.isBefore( endDate ) ) {\n\t\t\tlet row = getRow( rows, i++ );\n\t\t\trow.push( this.renderDay( startDate, startOfMonth, endOfMonth ) );\n\t\t\tstartDate.add( 1, 'd' );\n\t\t}\n\n\t\treturn rows.map( (r, i) => (\n\t\t\t{ r }\n\t\t));\n\t}\n\n\trenderDay( date, startOfMonth, endOfMonth ) {\n\t\tlet selectedDate = this.props.selectedDate;\n\n\t\tlet dayProps = {\n\t\t\tkey: date.format('M_D'),\n\t\t\t'data-value': date.date(),\n\t\t\t'data-month': date.month(),\n\t\t\t'data-year': date.year()\n\t\t};\n\n\t\tlet className = 'rdtDay';\n\t\tif ( date.isBefore( startOfMonth ) ) {\n\t\t\tclassName += ' rdtOld';\n\t\t}\n\t\telse if ( date.isAfter( endOfMonth ) ) {\n\t\t\tclassName += ' rdtNew';\n\t\t}\n\t\tif ( selectedDate && date.isSame( selectedDate, 'day' ) ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\t\tif ( date.isSame( this.props.moment(), 'day' ) ) {\n\t\t\tclassName += ' rdtToday';\n\t\t}\n\n\t\tif ( this.props.isValidDate(date) ) {\n\t\t\tdayProps.onClick = this._setDate;\n\t\t}\n\t\telse {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\n\t\tdayProps.className = className;\n\n\t\treturn this.props.renderDay(\n\t\t\tdayProps, date.clone(), selectedDate && selectedDate.clone()\n\t\t);\n\t}\n\n\trenderFooter() {\n\t\tif ( !this.props.timeFormat ) return;\n\n\t\tconst date = this.props.viewDate;\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('time') }\n\t\t\t\t\t\tcolSpan={7}\n\t\t\t\t\t\tclassName=\"rdtTimeToggle\">\n\t\t\t\t\t\t{ date.format( this.props.timeFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t_setDate = e => {\n\t\tthis.props.updateDate( e );\n\t}\n}\n\nfunction getRow( rows, day ) {\n\treturn rows[ Math.floor( day / 7 ) ];\n}\n\n/**\n * Get a list of the days of the week\n * depending on the current locale\n * @return {array} A list with the shortname of the days\n */\nfunction getDaysOfWeek( locale ) {\n\tconst first = locale.firstDayOfWeek();\n\tlet dow = [];\n\tlet i = 0;\n\n\tlocale._weekdaysMin.forEach(function (day) {\n\t\tdow[(7 + (i++) - first) % 7] = day;\n\t});\n\n\treturn dow;\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class MonthsView extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderMonths() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tlet year = this.props.viewDate.year();\n\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'years' ) }\n\t\t\t\tswitchContent={ year }\n\t\t\t\tswitchColSpan=\"2\"\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderMonths() {\n\t\t// 12 months in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\n\t\tfor ( let month = 0; month < 12; month++ ) {\n\t\t\tlet row = getRow( rows, month );\n\n\t\t\trow.push( this.renderMonth( month ) );\n\t\t}\n\n\t\treturn rows.map( (months, i) => (\n\t\t\t{ months }\n\t\t));\n\t}\n\n\trenderMonth( month ) {\n\t\tconst selectedDate = this.props.selectedDate;\n\t\tlet className = 'rdtMonth';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledMonth( month ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedMonth;\n\t\t}\n\n\t\tif ( selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: month, className, 'data-value': month, onClick };\n\n\t\tif ( this.props.renderMonth ) {\n\t\t\treturn this.props.renderMonth(\n\t\t\t\tprops,\n\t\t\t\tmonth,\n\t\t\t\tthis.props.viewDate.year(),\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.getMonthText( month ) }\n\t\t\t\n\t\t);\n\t}\n\t\n\tisDisabledMonth( month ) {\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the month is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({month});\n\t\tlet day = date.endOf( 'month' ).date() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.date(day) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgetMonthText( month ) {\n\t\tconst localMoment = this.props.viewDate;\n\t\tconst monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\treturn capitalize( monthStr.substring( 0, 3 ) );\n\t}\n\n\t_updateSelectedMonth = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 4 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 8 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n\nfunction capitalize( str ) {\n\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class YearsView extends React.Component {\n\tstatic defaultProps = {\n\t\trenderYear: ( props, year ) => { year },\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderYears() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst viewYear = this.getViewYear();\n\t\treturn (\n\t\t\t this.props.navigate( -10, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 10, 'years' ) }\n\t\t\t\tswitchContent={ `${viewYear}-${viewYear + 9}` }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderYears() {\n\t\tconst viewYear = this.getViewYear();\n\t\t// 12 years in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\t\tfor ( let year = viewYear - 1; year < viewYear + 11; year++ ) {\n\t\t\tlet row = getRow( rows, year - viewYear );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderYear( year )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (years, i) => (\n\t\t\t{ years }\n\t\t));\n\t}\n\n\trenderYear( year ) {\n\t\tconst selectedYear = this.getSelectedYear();\n\t\tlet className = 'rdtYear';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledYear( year ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedYear;\n\t\t}\n\n\t\tif ( selectedYear === year ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: year, className, 'data-value': year, onClick };\n\n\t\treturn this.props.renderYear(\n\t\t\tprops,\n\t\t\tyear,\n\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t);\n\t}\n\n\tgetViewYear() {\n\t\treturn parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\t}\n\n\tgetSelectedYear() {\n\t\treturn this.props.selectedDate && this.props.selectedDate.year();\n\t}\n\n\tdisabledYearsCache = {};\n\tisDisabledYear( year ) {\n\t\tlet cache = this.disabledYearsCache;\n\t\tif ( cache[year] !== undefined ) {\n\t\t\treturn cache[year];\n\t\t}\n\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the year is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({year});\n\t\tlet day = date.endOf( 'year' ).dayOfYear() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.dayOfYear(day) ) ) {\n\t\t\t\tcache[year] = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tcache[year] = true;\n\t\treturn true;\n\t}\n\n\t_updateSelectedYear = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 3 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 7 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n","import React, { useCallback, useEffect, useState } from 'react';\nimport moment from 'moment-timezone';\n\nconst timeConstraints = {\n\thours: {\n\t\tmin: 0,\n\t\tmax: 23,\n\t\tstep: 1\n\t},\n\tminutes: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tseconds: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tmilliseconds: {\n\t\tmin: 0,\n\t\tmax: 999,\n\t\tstep: 1\n\t}\n};\n\nfunction createConstraints( overrideTimeConstraints ) {\n\tlet constraints = {};\n\n\tObject.keys( timeConstraints ).forEach( type => {\n\t\tconstraints[ type ] = { ...timeConstraints[type], ...(overrideTimeConstraints[type] || {}) };\n\t});\n\n\treturn constraints;\n}\n\nexport const IntegerInput = ({value, onChange, min, max}) => {\n\tconst [stateValue, setStateValue] = useState(value);\n\tconst invalid = parseInt(stateValue, 10) !== parseInt(value, 10);\n\n\tconst parsedValue = parseInt(value, 10);\n\tuseEffect(() => {\n\t\tsetStateValue(`${parsedValue}`);\n\t}, [parsedValue]);\n\n\tconst onChangeCallback = useCallback((e) => {\n\t\tsetStateValue(e.target.value);\n\t\tconst parsedValue = parseInt(e.target.value, 10);\n\t\tif (parsedValue || parsedValue === 0) {\n\t\t\tif (parsedValue >= min && parsedValue <= max) {\n\t\t\t\tonChange(parsedValue);\n\t\t\t}\n\t\t}\n\t}, [onChange, max, min, setStateValue]);\n\n\treturn (\n\t\t\n\t);\n};\n\nexport default class TimeView extends React.Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.constraints = createConstraints( props.timeConstraints );\n\n\t\t// This component buffers the time part values in the state \n\t\t// while the user is pressing down the buttons\n\t\t// and call the prop `setTime` when the buttons are released\n\t\tthis.state = this.getTimeParts( props.selectedDate || props.viewDate );\n\t}\n\n\trender() {\n\t\tlet items = [];\n\t\tconst timeParts = this.state;\n\t\tthis.getCounters().forEach( (c, i) => {\n\t\t\tif ( i && c !== 'ampm' ) {\n\t\t\t\titems.push(\n\t\t\t\t\t
:
\n\t\t\t\t);\n\t\t\t}\n\t\t\titems.push( this.renderCounter(c, timeParts[c]) );\n\t\t});\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{ this.renderHeader() }\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ this.props.showTimeZone && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t(GMT{ moment.tz(this.props.displayTimeZone || moment.tz.guess() ).format('Z') })\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{ this.props.displayTimeZone || moment.tz.guess() }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{ items }\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\tsetNumber(value, type) {\n\t\tthis.props.setTime( type, parseInt( value, 10 ) );\n\t}\n\n\trenderCounter( type, value ) {\n\t\tif ( type === 'hours' && this.isAMPM() ) {\n\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\tif ( value === 0 ) {\n\t\t\t\tvalue = 12;\n\t\t\t}\n\t\t}\n\n\t\tif ( type === 'ampm' ) {\n\t\t\tif ( this.props.timeFormat.indexOf(' A') !== -1 ) {\n\t\t\t\tvalue = this.props.viewDate.format('A');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = this.props.viewDate.format('a');\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'increase', type)}>▲\n\t\t\t\t
\n\t\t\t\t\t{ (type !== 'ampm') ? (\n\t\t\t\t\t\t this.setNumber(value, type)}\n\t\t\t\t\t\t\tmin={timeConstraints[type].min}\n\t\t\t\t\t\t\tmax={timeConstraints[type].max}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : value }\n\t\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'decrease', type)}>▼\n\t\t\t
\n\t\t);\n\t}\n\n\trenderHeader() {\n\t\tif ( !this.props.dateFormat ) return;\n\n\t\tconst date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('days') }>\n\t\t\t\t\t\t{ date.format( this.props.dateFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\tonStartClicking( e, action, type ) {\n\t\tif ( e && e.button && e.button !== 0 ) {\n\t\t\t// Only left clicks, thanks\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( type === 'ampm' ) return this.toggleDayPart();\n\n\t\tlet update = {};\n\t\tlet body = document.body;\n\t\tupdate[ type ] = this[ action ]( type );\n\t\tthis.setState( update );\n\n\t\tthis.timer = setTimeout( () => {\n\t\t\tthis.increaseTimer = setInterval( () => {\n\t\t\t\tupdate[ type ] = this[ action ]( type );\n\t\t\t\tthis.setState( update );\n\t\t\t}, 70);\n\t\t}, 500);\n\n\t\tthis.mouseUpListener = () => {\n\t\t\tclearTimeout( this.timer );\n\t\t\tclearInterval( this.increaseTimer );\n\t\t\tthis.props.setTime( type, parseInt( this.state[ type ], 10 ) );\n\t\t\tbody.removeEventListener( 'mouseup', this.mouseUpListener );\n\t\t\tbody.removeEventListener( 'touchend', this.mouseUpListener );\n\t\t};\n\n\t\tbody.addEventListener( 'mouseup', this.mouseUpListener );\n\t\tbody.addEventListener( 'touchend', this.mouseUpListener );\n\t}\n\n\ttoggleDayPart() {\n\t\tlet hours = parseInt( this.state.hours, 10 );\n\t\t\n\t\tif ( hours >= 12 ) {\n\t\t\thours -= 12;\n\t\t}\n\t\telse {\n\t\t\thours += 12;\n\t\t}\n\n\t\tthis.props.setTime( 'hours', hours );\n\t}\n\n\tincrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) + tc.step;\n\t\tif ( value > tc.max )\n\t\t\tvalue = tc.min + ( value - ( tc.max + 1 ) );\n\t\treturn pad( type, value );\n\t}\n\n\tdecrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) - tc.step;\n\t\tif ( value < tc.min )\n\t\t\tvalue = tc.max + 1 - ( tc.min - value );\n\t\treturn pad( type, value );\n\t}\n\n\tgetCounters() {\n\t\tlet counters = [];\n\t\tlet format = this.props.timeFormat;\n\t\t\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t\tif ( format.indexOf('S') !== -1 ) {\n\t\t\t\t\t\tcounters.push('milliseconds');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.isAMPM() ) {\n\t\t\tcounters.push('ampm');\n\t\t}\n\n\t\treturn counters;\n\t}\n\n\tisAMPM() {\n\t\treturn this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1;\n\t}\n\n\tgetTimeParts( date ) {\n\t\tconst hours = date.hours();\n\n\t\treturn {\n\t\t\thours: pad( 'hours', hours ),\n\t\t\tminutes: pad( 'minutes', date.minutes() ),\n\t\t\tseconds: pad( 'seconds', date.seconds() ),\n\t\t\tmilliseconds: pad('milliseconds', date.milliseconds() ),\n\t\t\tampm: hours < 12 ? 'am' : 'pm'\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.selectedDate ) {\n\t\t\tif ( this.props.selectedDate !== prevProps.selectedDate ) {\n\t\t\t\tthis.setState( this.getTimeParts( this.props.selectedDate ) );\n\t\t\t}\n\t\t}\n\t\telse if ( prevProps.viewDate !== this.props.viewDate ) {\n\t\t\tthis.setState( this.getTimeParts( this.props.viewDate ) );\n\t\t}\n\t}\n}\n\nfunction pad( type, value ) {\n\tconst padValues = {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t};\n\n\tlet str = value + '';\n\twhile ( str.length < padValues[ type ] )\n\t\tstr = '0' + str;\n\treturn str;\n}\n","import {createElement,Component}from'react';import {findDOMNode}from'react-dom';function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n // Also cover shadowRoot node by checking current.host\n\n\n while (current.parentNode || current.host) {\n // Only check normal node without shadowRoot\n if (current.parentNode && isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode || current.host;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};function autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();var passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class = /*#__PURE__*/function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n }\n /**\n * Remove all document's event listeners for this component\n */\n ;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n }\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n ;\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _this$props = this.props;\n _this$props.excludeScrollbar;\n var props = _objectWithoutPropertiesLoose(_this$props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}export default onClickOutsideHOC;export{IGNORE_CLASS_NAME};","import PropTypes from 'prop-types';\nimport moment from 'moment';\nimport React from 'react';\nimport DaysView from './views/DaysView';\nimport MonthsView from './views/MonthsView';\nimport YearsView from './views/YearsView';\nimport TimeView from './views/TimeView';\nimport onClickOutside from 'react-onclickoutside';\n\nconst viewModes = {\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n};\n\nconst TYPES = PropTypes;\nconst nofn = function () {};\nconst datetype = TYPES.oneOfType([ TYPES.instanceOf(moment), TYPES.instanceOf(Date), TYPES.string ]);\n\nexport default class Datetime extends React.Component {\n\tstatic propTypes = {\n\t\tvalue: datetype,\n\t\tinitialValue: datetype,\n\t\tinitialViewDate: datetype,\n\t\tinitialViewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tonOpen: TYPES.func,\n\t\tonClose: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonNavigate: TYPES.func,\n\t\tonBeforeNavigate: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tupdateOnView: TYPES.string,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\tdisplayTimeFirst: TYPES.bool,\n\t\tshowTimeZone: TYPES.bool,\n\t\tdateFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\ttimeFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool,\n\t\trenderView: TYPES.func,\n\t\trenderInput: TYPES.func,\n\t\trenderDay: TYPES.func,\n\t\trenderMonth: TYPES.func,\n\t\trenderYear: TYPES.func,\n\t}\n\n\tstatic defaultProps = {\n\t\tonOpen: nofn,\n\t\tonClose: nofn,\n\t\tonCalendarOpen: nofn,\n\t\tonCalendarClose: nofn,\n\t\tonChange: nofn,\n\t\tonNavigate: nofn,\n\t\tonBeforeNavigate: function(next) { return next; }, \n\t\tonNavigateBack: nofn,\n\t\tonNavigateForward: nofn,\n\t\tdateFormat: true,\n\t\ttimeFormat: true,\n\t\tutc: false,\n\t\tclassName: '',\n\t\tinput: true,\n\t\tinputProps: {},\n\t\ttimeConstraints: {},\n\t\tisValidDate: function() { return true; },\n\t\tstrictParsing: true,\n\t\tcloseOnSelect: false,\n\t\tcloseOnTab: true,\n\t\tcloseOnClickOutside: true,\n\t\trenderView: ( _, renderFunc ) => renderFunc(),\n\t}\n\n\t// Make moment accessible through the Datetime class\n\tstatic moment = moment;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = this.getInitialState();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.renderInput() }\n\t\t\t\t
\n\t\t\t\t\t{ this.renderView() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif ( !this.props.input ) return;\n\n\t\tconst finalInputProps = {\n\t\t\ttype: 'text',\n\t\t\tclassName: 'form-control',\n\t\t\tvalue: this.getInputValue(),\n\t\t\t...this.props.inputProps,\n\t\t\tonFocus: this._onInputFocus,\n\t\t\tonChange: this._onInputChange,\n\t\t\tonKeyDown: this._onInputKeyDown,\n\t\t\tonClick: this._onInputClick\n\t\t};\n\n\t\tif ( this.props.renderInput ) { \n\t\t\treturn (\n\t\t\t\t
\n\t\t\t\t\t{ this.props.renderInput( finalInputProps, this._openCalendar, this._closeCalendar ) }\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n\n\trenderView() {\n\t\treturn this.props.renderView( this.state.currentView, this._renderCalendar );\n\t}\n\n\t_renderCalendar = () => {\n\t\tconst props = this.props;\n\t\tconst state = this.state;\n\n\t\tlet viewProps = {\n\t\t\tviewDate: state.viewDate.clone(),\n\t\t\tselectedDate: this.getSelectedDate(),\n\t\t\tisValidDate: props.isValidDate,\n\t\t\tupdateDate: this._updateDate,\n\t\t\tnavigate: this._viewNavigate,\n\t\t\tmoment: moment,\n\t\t\tshowView: this._showView,\n\t\t\tdisplayTimeZone: props.displayTimeZone,\n\t\t\tshowTimeZone: props.showTimeZone,\n\t\t};\n\n\t\t// Probably updateOn, updateSelectedDate and setDate can be merged in the same method\n\t\t// that would update viewDate or selectedDate depending on the view and the dateFormat\n\t\tswitch ( state.currentView ) {\n\t\t\tcase viewModes.YEARS:\n\t\t\t\t// Used viewProps\n\t\t\t\t// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderYear = props.renderYear;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.MONTHS:\n\t\t\t\t// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderMonth = props.renderMonth;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.DAYS:\n\t\t\t\t// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat \n\t\t\t\tviewProps.renderDay = props.renderDay;\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t// { viewDate, selectedDate, timeFormat, dateFormat, timeConstraints, setTime, showView }\n\t\t\t\tviewProps.dateFormat = this.getFormat('date');\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\tviewProps.timeConstraints = props.timeConstraints;\n\t\t\t\tviewProps.setTime = this._setTime;\n\t\t\t\treturn ;\n\t\t}\n\t}\n\n\tgetInitialState() {\n\t\tlet props = this.props;\n\t\tlet inputFormat = this.getFormat('datetime');\n\t\tlet selectedDate = this.parseDate( props.value || props.initialValue, inputFormat );\n\n\t\tthis.checkTZ();\n\n\t\treturn {\n\t\t\topen: !props.input,\n\t\t\tcurrentView: props.initialViewMode || this.getInitialView(),\n\t\t\tviewDate: this.getInitialViewDate( selectedDate ),\n\t\t\tselectedDate: selectedDate && selectedDate.isValid() ? selectedDate : undefined,\n\t\t\tinputValue: this.getInitialInputValue( selectedDate )\n\t\t};\n\t}\n\t\n\tgetInitialViewDate( selectedDate ) {\n\t\tconst propDate = this.props.initialViewDate;\n\t\tlet viewDate;\n\t\tif ( propDate ) {\n\t\t\tviewDate = this.parseDate( propDate, this.getFormat('datetime') );\n\t\t\tif ( viewDate && viewDate.isValid() ) {\n\t\t\t\treturn viewDate;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog('The initialViewDated given \"' + propDate + '\" is not valid. Using current date instead.');\n\t\t\t}\n\t\t}\n\t\telse if ( selectedDate && selectedDate.isValid() ) {\n\t\t\treturn selectedDate.clone();\n\t\t}\n\t\treturn this.getInitialDate();\n\t}\n\n\tgetInitialDate() {\n\t\tlet m = this.localMoment();\n\t\tm.hour(0).minute(0).second(0).millisecond(0);\n\t\treturn m;\n\t}\n\n\tgetInitialView() {\n\t\tconst dateFormat = this.getFormat( 'date' );\n\t\treturn dateFormat ? this.getUpdateOn( dateFormat ) : viewModes.TIME;\n\t}\n\n\tparseDate(date, dateFormat) {\n\t\tlet parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, dateFormat);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t}\n\n\tgetClassName() {\n\t\tlet cn = 'rdt';\n\t\tlet props = this.props;\n\t\tlet propCn = props.className;\n\n\t\tif ( Array.isArray( propCn ) ) {\n\t\t\tcn += ' ' + propCn.join(' ');\n\t\t}\n\t\telse if ( propCn ) {\n\t\t\tcn += ' ' + propCn;\n\t\t}\n\n\t\tif ( !props.input ) {\n\t\t\tcn += ' rdtStatic';\n\t\t}\n\t\tif ( this.isOpen() ) {\n\t\t\tcn += ' rdtOpen';\n\t\t}\n\n\t\treturn cn;\n\t}\n\t\n\tisOpen() {\n\t\treturn !this.props.input || (this.props.open === undefined ? this.state.open : this.props.open);\n\t}\n\n\tgetUpdateOn( dateFormat ) {\n\t\tif ( this.props.updateOnView ) {\n\t\t\treturn this.props.updateOnView;\n\t\t}\n\n\t\tif ( dateFormat.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t}\n\n\tgetLocaleData() {\n\t\tlet p = this.props;\n\t\treturn this.localMoment( p.value || p.defaultValue || new Date() ).localeData();\n\t}\n\n\tgetDateFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.dateFormat;\n\t\tif ( format === true ) return locale.longDateFormat('L');\n\t\tif ( format ) return format;\n\t\treturn '';\n\t}\n\n\tgetTimeFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.timeFormat;\n\t\tif ( format === true ) {\n\t\t\treturn locale.longDateFormat('LT');\n\t\t}\n\t\treturn format || '';\n\t}\n\n\tgetFormat( type ) {\n\t\tif ( type === 'date' ) {\n\t\t\treturn this.getDateFormat();\n\t\t}\n\t\telse if ( type === 'time' ) {\n\t\t\treturn this.getTimeFormat();\n\t\t}\n\t\t\n\t\tlet dateFormat = this.getDateFormat();\n\t\tlet timeFormat = this.getTimeFormat();\n\t\tconst combinedDateTimeFormat = this.props.showTimeFirst ? `${timeFormat} ${dateFormat}` : `${dateFormat} ${timeFormat}`;\n\t\treturn dateFormat && timeFormat ? combinedDateTimeFormat : (dateFormat || timeFormat );\n\t}\n\n\t_showView = ( view, date ) => {\n\t\tconst d = ( date || this.state.viewDate ).clone();\n\t\tconst nextView = this.props.onBeforeNavigate( view, this.state.currentView, d );\n\n\t\tif ( nextView && this.state.currentView !== nextView ) {\n\t\t\tthis.props.onNavigate( nextView );\n\t\t\tthis.setState({ currentView: nextView });\n\t\t}\n\t}\n\n\tupdateTime( op, amount, type, toSelected ) {\n\t\tlet update = {};\n\t\tconst date = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t}\n\n\tviewToMethod = {days: 'date', months: 'month', years: 'year'};\n\tnextView = { days: 'time', months: 'days', years: 'months'};\n\t_updateDate = e => {\n\t\tlet state = this.state;\n\t\tlet currentView = state.currentView;\n\t\tlet updateOnView = this.getUpdateOn( this.getFormat('date') );\n\t\tlet viewDate = this.state.viewDate.clone();\n\n\t\t// Set the value into day/month/year\n\t\tviewDate[ this.viewToMethod[currentView] ](\n\t\t\tparseInt( e.target.getAttribute('data-value'), 10 )\n\t\t);\n\n\t\t// Need to set month and year will for days view (prev/next month)\n\t\tif ( currentView === 'days' ) {\n\t\t\tviewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );\n\t\t\tviewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );\n\t\t}\n\n\t\tlet update = {viewDate: viewDate};\n\t\tif ( currentView === updateOnView ) {\n\t\t\tupdate.selectedDate = viewDate.clone();\n\t\t\tupdate.inputValue = viewDate.format( this.getFormat('datetime') );\n\n\t\t\tif ( this.props.open === undefined && this.props.input && this.props.closeOnSelect ) {\n\t\t\t\tthis._closeCalendar();\n\t\t\t}\n\n\t\t\tthis.props.onChange( viewDate.clone() );\n\t\t}\n\t\telse {\n\t\t\tthis._showView( this.nextView[ currentView ], viewDate );\n\t\t}\n\n\t\tthis.setState( update );\n\t}\n\n\t_viewNavigate = ( modifier, unit ) => {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\t\n\t\t// Subtracting is just adding negative time\n\t\tviewDate.add( modifier, unit );\n\n\t\tif ( modifier > 0 ) {\n\t\t\tthis.props.onNavigateForward( modifier, unit );\n\t\t}\n\t\telse {\n\t\t\tthis.props.onNavigateBack( -(modifier), unit );\n\t\t}\n\n\t\tthis.setState({viewDate});\n\t}\n\t\n\t_setTime = ( type, value ) => {\n\t\tlet date = (this.getSelectedDate() || this.state.viewDate).clone();\n\t\t\n\t\tdate[ type ]( value );\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone(),\n\t\t\t\tinputValue: date.format( this.getFormat('datetime') )\n\t\t\t});\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t}\n\n\t_openCalendar = () => {\n\t\tif ( this.isOpen() ) return;\n\t\tthis.setState({open: true}, this.props.onOpen );\n\t}\n\n\t_closeCalendar = () => {\n\t\tif ( !this.isOpen() ) return;\n\n\t\tthis.setState({open: false}, () => {\n\t\t\t this.props.onClose( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t}\n\n\t_handleClickOutside = () => {\n\t\tlet props = this.props;\n\n\t\tif ( props.input && this.state.open && props.open === undefined && props.closeOnClickOutside ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\tlocalMoment( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tlet m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t}\n\n\tcheckTZ() {\n\t\tconst { displayTimeZone } = this.props;\n\t\tif ( displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tlog('displayTimeZone prop with value \"' + displayTimeZone + '\" is used but moment.js timezone is not loaded.', 'error');\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( prevProps === this.props ) return;\n\n\t\tlet needsUpdate = false;\n\t\tlet thisProps = this.props;\n\n\t\t['locale', 'utc', 'displayZone', 'dateFormat', 'timeFormat'].forEach( function(p) {\n\t\t\tprevProps[p] !== thisProps[p] && (needsUpdate = true);\n\t\t});\n\n\t\tif ( needsUpdate ) {\n\t\t\tthis.regenerateDates();\n\t\t}\n\n\t\tif ( thisProps.value && thisProps.value !== prevProps.value ) {\n\t\t\tthis.setViewDate( thisProps.value );\n\t\t}\n\n\t\tthis.checkTZ();\n\t}\n\n\tregenerateDates() {\n\t\tconst props = this.props;\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\tlet selectedDate = this.state.selectedDate && this.state.selectedDate.clone();\n\n\t\tif ( props.locale ) {\n\t\t\tviewDate.locale( props.locale );\n\t\t\tselectedDate &&\tselectedDate.locale( props.locale );\n\t\t}\n\t\tif ( props.utc ) {\n\t\t\tviewDate.utc();\n\t\t\tselectedDate &&\tselectedDate.utc();\n\t\t}\n\t\telse if ( props.displayTimeZone ) {\n\t\t\tviewDate.tz( props.displayTimeZone );\n\t\t\tselectedDate &&\tselectedDate.tz( props.displayTimeZone );\n\t\t}\n\t\telse {\n\t\t\tviewDate.locale();\n\t\t\tselectedDate &&\tselectedDate.locale();\n\t\t}\n\n\t\tlet update = { viewDate: viewDate, selectedDate: selectedDate};\n\t\tif ( selectedDate && selectedDate.isValid() ) {\n\t\t\tupdate.inputValue = selectedDate.format( this.getFormat('datetime') );\n\t\t}\n\t\tthis.setState( update );\n\t}\n\n\tgetSelectedDate() {\n\t\tif ( this.props.value === undefined ) return this.state.selectedDate;\n\t\tlet selectedDate = this.parseDate( this.props.value, this.getFormat('datetime') );\n\t\treturn selectedDate && selectedDate.isValid() ? selectedDate : false;\n\t}\n\n\tgetInitialInputValue( selectedDate ) {\n\t\tconst props = this.props;\n\t\tif ( props.inputProps.value )\n\t\t\treturn props.inputProps.value;\n\t\t\n\t\tif ( selectedDate && selectedDate.isValid() )\n\t\t\treturn selectedDate.format( this.getFormat('datetime') );\n\t\t\n\t\tif ( props.value && typeof props.value === 'string' )\n\t\t\treturn props.value;\n\t\t\n\t\tif ( props.initialValue && typeof props.initialValue === 'string' )\n\t\t\treturn props.initialValue;\n\t\t\n\t\treturn '';\n\t}\n\n\tgetInputValue() {\n\t\treturn this.state.inputValue;\n\t}\n\n\t/**\n\t * Set the date that is currently shown in the calendar.\n\t * This is independent from the selected date and it's the one used to navigate through months or days in the calendar.\n\t * @param dateType date\n\t * @public\n\t */\n\tsetViewDate( date ) {\n\t\tlet logError = function() {\n\t\t\treturn log( 'Invalid date passed to the `setViewDate` method: ' + date );\n\t\t};\n\n\t\tif ( !date ) return logError();\n\t\t\n\t\tlet viewDate;\n\t\tif ( typeof date === 'string' ) {\n\t\t\tviewDate = this.localMoment(date, this.getFormat('datetime') );\n\t\t}\n\t\telse {\n\t\t\tviewDate = this.localMoment( date );\n\t\t}\n\n\t\tif ( !viewDate || !viewDate.isValid() ) return logError();\n\t\tlet selectedDate = this.getSelectedDate();\n\t\tthis.setState({\n\t\t\tviewDate: viewDate,\n\t\t\tinputValue: selectedDate ? selectedDate.format( this.getFormat('datetime') ) : this.state.inputValue,\n\t\t});\n\t}\n\n\t/**\n\t * Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.\n\t * @param TYPES.string mode \n\t */\n\tnavigate( mode ) {\n\t\tthis._showView( mode );\n\t}\n\n\t_onInputFocus = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onFocus, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\t_onInputChange = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onChange, e ) ) return;\n\n\t\tconst value = e.target ? e.target.value : e;\n\t\tconst localMoment = this.localMoment( value, this.getFormat('datetime') );\n\t\tlet update = { inputValue: value };\n\n\t\tif ( localMoment.isValid() ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t}\n\t\telse {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\tthis.setState( update, () => {\n\t\t\tthis.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t}\n\n\t_onInputKeyDown = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onKeyDown, e ) ) return;\n\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\t_onInputClick = e => {\n\t\t// Focus event should open the calendar, but there is some case where\n\t\t// the input is already focused and the picker is closed, so clicking the input\n\t\t// should open it again see https://github.com/arqex/react-datetime/issues/717\n\t\tif ( !this.callHandler( this.props.inputProps.onClick, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\tcallHandler( method, e ) {\n\t\tif ( !method ) return true;\n\t\treturn method(e) !== false;\n\t}\n}\n\nfunction log( message, method ) {\n\tlet con = typeof window !== 'undefined' && window.console;\n\tif ( !con ) return;\n\n\tif ( !method ) {\n\t\tmethod = 'warn';\n\t}\n\tcon[ method ]( '***react-datetime:' + message );\n}\n\nclass ClickOutBase extends React.Component {\n\tcontainer = React.createRef();\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t{ this.props.children }\n\t\t\t
\n\t\t);\n\t}\n\thandleClickOutside(e) {\n\t\tthis.props.onClickOut( e );\n\t}\n\n\tsetClickOutsideRef() {\n\t\treturn this.container.current;\n\t}\n}\n\nconst ClickableWrapper = onClickOutside( ClickOutBase );\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Datetime/webpack/bootstrap","webpack://Datetime/external \"react\"","webpack://Datetime/external \"moment\"","webpack://Datetime/external \"moment-timezone\"","webpack://Datetime/external \"react-dom\"","webpack://Datetime/./node_modules/prop-types/index.js","webpack://Datetime/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://Datetime/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://Datetime/./src/parts/ViewNavigation.js","webpack://Datetime/./src/views/DaysView.js","webpack://Datetime/./src/views/MonthsView.js","webpack://Datetime/./src/views/YearsView.js","webpack://Datetime/./src/views/TimeView.js","webpack://Datetime/./node_modules/react-onclickoutside/dist/react-onclickoutside.es.js","webpack://Datetime/./src/DateTime.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","ViewNavigation","onClickPrev","onClickSwitch","onClickNext","switchContent","switchColSpan","switchProps","className","onClick","colSpan","DaysView","e","updateDate","this","renderNavigation","renderDayHeaders","renderDays","renderFooter","date","viewDate","locale","localeData","navigate","showView","months","year","month","dayItems","first","firstDayOfWeek","dow","_weekdaysMin","forEach","day","getDaysOfWeek","map","index","startOfMonth","clone","startOf","endOfMonth","endOf","rows","startDate","subtract","daysInMonth","endDate","add","isBefore","getRow","push","renderDay","selectedDate","dayProps","format","isAfter","isSame","moment","isValidDate","_setDate","timeFormat","React","Component","Math","floor","MonthsView","event","renderMonths","renderMonth","isDisabledMonth","_updateSelectedMonth","getMonthText","set","str","localMoment","monthStr","monthsShort","substring","charAt","toUpperCase","slice","YearsView","renderYears","viewYear","getViewYear","renderYear","years","selectedYear","getSelectedYear","isDisabledYear","_updateSelectedYear","parseInt","cache","disabledYearsCache","undefined","dayOfYear","timeConstraints","hours","min","max","step","minutes","seconds","milliseconds","IntegerInput","onChange","useState","stateValue","setStateValue","invalid","parsedValue","useEffect","onChangeCallback","useCallback","target","TimeView","overrideTimeConstraints","constraints","keys","type","state","getTimeParts","items","timeParts","getCounters","renderCounter","renderHeader","showTimeZone","tz","displayTimeZone","guess","setTime","isAMPM","indexOf","onMouseDown","onStartClicking","setNumber","dateFormat","action","button","toggleDayPart","update","body","document","setState","timer","setTimeout","increaseTimer","setInterval","mouseUpListener","clearTimeout","clearInterval","removeEventListener","addEventListener","tc","pad","counters","timeCountersFormat","toLowerCase","ampm","prevProps","padValues","length","setPrototypeOf","__proto__","self","ReferenceError","isNodeFound","current","componentNode","ignoreClass","correspondingElement","classList","contains","seed","passiveEventSupport","uid","handlersMap","enabledInstances","touchEvents","getEventHandlerOptions","instance","eventName","handlerOptions","passive","preventDefault","WrappedComponent","config","_class","_temp","displayName","_Component","subClass","superClass","onClickOutside","_this","__outsideClickHandler","__clickOutsideHandlerProp","getInstance","handleClickOutside","__getComponentNode","setClickOutsideRef","enableOnClickOutside","_uid","window","options","noop","testPassiveEventSupport","events","eventTypes","evt","stopPropagation","excludeScrollbar","documentElement","clientWidth","clientX","clientHeight","clientY","parentNode","host","findHighest","composed","composedPath","shift","outsideClickIgnoreClass","disableOnClickOutside","fn","getRef","ref","instanceRef","constructor","_proto","isReactComponent","componentDidMount","createElement","componentDidUpdate","componentWillUnmount","render","_this$props","source","excluded","sourceKeys","_objectWithoutPropertiesLoose","wrappedRef","defaultProps","getClass","viewModes","TYPES","nofn","datetype","Date","Datetime","viewProps","getSelectedDate","_updateDate","_viewNavigate","_showView","currentView","getFormat","_setTime","view","nextView","onBeforeNavigate","onNavigate","days","updateOnView","getUpdateOn","viewToMethod","getAttribute","inputValue","open","input","closeOnSelect","_closeCalendar","modifier","unit","onNavigateForward","onNavigateBack","isOpen","onOpen","onClose","closeOnClickOutside","callHandler","inputProps","onFocus","_openCalendar","isValid","onKeyDown","which","closeOnTab","getInitialState","ClickableWrapper","getClassName","onClickOut","_handleClickOutside","renderInput","renderView","finalInputProps","getInputValue","_onInputFocus","_onInputChange","_onInputKeyDown","_onInputClick","_renderCalendar","inputFormat","parseDate","initialValue","checkTZ","initialViewMode","getInitialView","getInitialViewDate","getInitialInputValue","propDate","initialViewDate","log","getInitialDate","hour","minute","second","millisecond","parsedDate","cn","propCn","Array","isArray","join","match","defaultValue","getLocaleData","longDateFormat","getDateFormat","getTimeFormat","combinedDateTimeFormat","showTimeFirst","op","amount","toSelected","utc","strictParsing","tzWarning","needsUpdate","thisProps","regenerateDates","setViewDate","logError","method","message","con","console","displayTimeFirst","onCalendarOpen","onCalendarClose","next","_","renderFunc","createRef","container","children"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,E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G3G,IAAMC","file":"react-datetime.cjs.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = require(\"react\");","module.exports = require(\"moment\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react-dom\");","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","import React from 'react';\n\nexport default function ViewNavigation( { onClickPrev, onClickSwitch, onClickNext, switchContent, switchColSpan, switchProps } ) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{ switchContent }\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class DaysView extends React.Component {\n\tstatic defaultProps = {\n\t\tisValidDate: () => true,\n\t\trenderDay: ( props, date ) => { date.date() },\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\t{ this.renderDayHeaders() }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderDays() }\n\t\t\t\t\t\n\t\t\t\t\t{ this.renderFooter() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst date = this.props.viewDate;\n\t\tconst locale = date.localeData();\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'months' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'months' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'months' ) }\n\t\t\t\tswitchContent={ locale.months( date ) + ' ' + date.year() }\n\t\t\t\tswitchColSpan={5}\n\t\t\t\tswitchProps={ { 'data-value': this.props.viewDate.month() } }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderDayHeaders() {\n\t\tconst locale = this.props.viewDate.localeData();\n\t\tlet dayItems = getDaysOfWeek( locale ).map( (day, index) => (\n\t\t\t{ day }\n\t\t));\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ dayItems }\n\t\t\t\n\t\t);\n\t}\n\n\trenderDays() {\n\t\tconst date = this.props.viewDate;\n\t\tconst startOfMonth = date.clone().startOf('month');\n\t\tconst endOfMonth = date.clone().endOf('month');\n\n\t\t// We need 42 days in 6 rows\n\t\t// starting in the last week of the previous month\n\t\tlet rows = [[], [], [], [], [], []];\n\n\t\tlet startDate = date.clone().subtract( 1, 'months');\n\t\tstartDate.date( startDate.daysInMonth() ).startOf('week');\n\n\t\tlet endDate = startDate.clone().add( 42, 'd' );\n\t\tlet i = 0;\n\n\t\twhile ( startDate.isBefore( endDate ) ) {\n\t\t\tlet row = getRow( rows, i++ );\n\t\t\trow.push( this.renderDay( startDate, startOfMonth, endOfMonth ) );\n\t\t\tstartDate.add( 1, 'd' );\n\t\t}\n\n\t\treturn rows.map( (r, i) => (\n\t\t\t{ r }\n\t\t));\n\t}\n\n\trenderDay( date, startOfMonth, endOfMonth ) {\n\t\tlet selectedDate = this.props.selectedDate;\n\n\t\tlet dayProps = {\n\t\t\tkey: date.format('M_D'),\n\t\t\t'data-value': date.date(),\n\t\t\t'data-month': date.month(),\n\t\t\t'data-year': date.year()\n\t\t};\n\n\t\tlet className = 'rdtDay';\n\t\tif ( date.isBefore( startOfMonth ) ) {\n\t\t\tclassName += ' rdtOld';\n\t\t}\n\t\telse if ( date.isAfter( endOfMonth ) ) {\n\t\t\tclassName += ' rdtNew';\n\t\t}\n\t\tif ( selectedDate && date.isSame( selectedDate, 'day' ) ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\t\tif ( date.isSame( this.props.moment(), 'day' ) ) {\n\t\t\tclassName += ' rdtToday';\n\t\t}\n\n\t\tif ( this.props.isValidDate(date) ) {\n\t\t\tdayProps.onClick = this._setDate;\n\t\t}\n\t\telse {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\n\t\tdayProps.className = className;\n\n\t\treturn this.props.renderDay(\n\t\t\tdayProps, date.clone(), selectedDate && selectedDate.clone()\n\t\t);\n\t}\n\n\trenderFooter() {\n\t\tif ( !this.props.timeFormat ) return;\n\n\t\tconst date = this.props.viewDate;\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('time') }\n\t\t\t\t\t\tcolSpan={7}\n\t\t\t\t\t\tclassName=\"rdtTimeToggle\">\n\t\t\t\t\t\t{ date.format( this.props.timeFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t_setDate = e => {\n\t\tthis.props.updateDate( e );\n\t}\n}\n\nfunction getRow( rows, day ) {\n\treturn rows[ Math.floor( day / 7 ) ];\n}\n\n/**\n * Get a list of the days of the week\n * depending on the current locale\n * @return {array} A list with the shortname of the days\n */\nfunction getDaysOfWeek( locale ) {\n\tconst first = locale.firstDayOfWeek();\n\tlet dow = [];\n\tlet i = 0;\n\n\tlocale._weekdaysMin.forEach(function (day) {\n\t\tdow[(7 + (i++) - first) % 7] = day;\n\t});\n\n\treturn dow;\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class MonthsView extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderMonths() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tlet year = this.props.viewDate.year();\n\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'years' ) }\n\t\t\t\tswitchContent={ year }\n\t\t\t\tswitchColSpan=\"2\"\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderMonths() {\n\t\t// 12 months in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\n\t\tfor ( let month = 0; month < 12; month++ ) {\n\t\t\tlet row = getRow( rows, month );\n\n\t\t\trow.push( this.renderMonth( month ) );\n\t\t}\n\n\t\treturn rows.map( (months, i) => (\n\t\t\t{ months }\n\t\t));\n\t}\n\n\trenderMonth( month ) {\n\t\tconst selectedDate = this.props.selectedDate;\n\t\tlet className = 'rdtMonth';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledMonth( month ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedMonth;\n\t\t}\n\n\t\tif ( selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: month, className, 'data-value': month, onClick };\n\n\t\tif ( this.props.renderMonth ) {\n\t\t\treturn this.props.renderMonth(\n\t\t\t\tprops,\n\t\t\t\tmonth,\n\t\t\t\tthis.props.viewDate.year(),\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.getMonthText( month ) }\n\t\t\t\n\t\t);\n\t}\n\t\n\tisDisabledMonth( month ) {\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the month is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({month});\n\t\tlet day = date.endOf( 'month' ).date() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.date(day) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgetMonthText( month ) {\n\t\tconst localMoment = this.props.viewDate;\n\t\tconst monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\treturn capitalize( monthStr.substring( 0, 3 ) );\n\t}\n\n\t_updateSelectedMonth = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 4 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 8 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n\nfunction capitalize( str ) {\n\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class YearsView extends React.Component {\n\tstatic defaultProps = {\n\t\trenderYear: ( props, year ) => { year },\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderYears() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst viewYear = this.getViewYear();\n\t\treturn (\n\t\t\t this.props.navigate( -10, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 10, 'years' ) }\n\t\t\t\tswitchContent={ `${viewYear}-${viewYear + 9}` }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderYears() {\n\t\tconst viewYear = this.getViewYear();\n\t\t// 12 years in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\t\tfor ( let year = viewYear - 1; year < viewYear + 11; year++ ) {\n\t\t\tlet row = getRow( rows, year - viewYear );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderYear( year )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (years, i) => (\n\t\t\t{ years }\n\t\t));\n\t}\n\n\trenderYear( year ) {\n\t\tconst selectedYear = this.getSelectedYear();\n\t\tlet className = 'rdtYear';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledYear( year ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedYear;\n\t\t}\n\n\t\tif ( selectedYear === year ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: year, className, 'data-value': year, onClick };\n\n\t\treturn this.props.renderYear(\n\t\t\tprops,\n\t\t\tyear,\n\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t);\n\t}\n\n\tgetViewYear() {\n\t\treturn parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\t}\n\n\tgetSelectedYear() {\n\t\treturn this.props.selectedDate && this.props.selectedDate.year();\n\t}\n\n\tdisabledYearsCache = {};\n\tisDisabledYear( year ) {\n\t\tlet cache = this.disabledYearsCache;\n\t\tif ( cache[year] !== undefined ) {\n\t\t\treturn cache[year];\n\t\t}\n\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the year is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({year});\n\t\tlet day = date.endOf( 'year' ).dayOfYear() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.dayOfYear(day) ) ) {\n\t\t\t\tcache[year] = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tcache[year] = true;\n\t\treturn true;\n\t}\n\n\t_updateSelectedYear = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 3 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 7 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n","import React, { useCallback, useEffect, useState } from 'react';\nimport moment from 'moment-timezone';\n\nconst timeConstraints = {\n\thours: {\n\t\tmin: 0,\n\t\tmax: 23,\n\t\tstep: 1\n\t},\n\tminutes: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tseconds: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tmilliseconds: {\n\t\tmin: 0,\n\t\tmax: 999,\n\t\tstep: 1\n\t}\n};\n\nfunction createConstraints( overrideTimeConstraints ) {\n\tlet constraints = {};\n\n\tObject.keys( timeConstraints ).forEach( type => {\n\t\tconstraints[ type ] = { ...timeConstraints[type], ...(overrideTimeConstraints[type] || {}) };\n\t});\n\n\treturn constraints;\n}\n\nexport const IntegerInput = ({value, onChange, min, max}) => {\n\tconst [stateValue, setStateValue] = useState(value);\n\tconst invalid = parseInt(stateValue, 10) !== parseInt(value, 10);\n\n\tconst parsedValue = parseInt(value, 10);\n\tuseEffect(() => {\n\t\tsetStateValue(`${parsedValue}`);\n\t}, [parsedValue]);\n\n\tconst onChangeCallback = useCallback((e) => {\n\t\tsetStateValue(e.target.value);\n\t\tconst parsedValue = parseInt(e.target.value, 10);\n\t\tif (parsedValue || parsedValue === 0) {\n\t\t\tif (parsedValue >= min && parsedValue <= max) {\n\t\t\t\tonChange(parsedValue);\n\t\t\t}\n\t\t}\n\t}, [onChange, max, min, setStateValue]);\n\n\treturn (\n\t\t\n\t);\n};\n\nexport default class TimeView extends React.Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.constraints = createConstraints( props.timeConstraints );\n\n\t\t// This component buffers the time part values in the state \n\t\t// while the user is pressing down the buttons\n\t\t// and call the prop `setTime` when the buttons are released\n\t\tthis.state = this.getTimeParts( props.selectedDate || props.viewDate );\n\t}\n\n\trender() {\n\t\tlet items = [];\n\t\tconst timeParts = this.state;\n\t\tthis.getCounters().forEach( (c, i) => {\n\t\t\tif ( i && c !== 'ampm' ) {\n\t\t\t\titems.push(\n\t\t\t\t\t
:
\n\t\t\t\t);\n\t\t\t}\n\t\t\titems.push( this.renderCounter(c, timeParts[c]) );\n\t\t});\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{ this.renderHeader() }\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ this.props.showTimeZone && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t(GMT{ moment.tz(this.props.displayTimeZone || moment.tz.guess() ).format('Z') })\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{ this.props.displayTimeZone || moment.tz.guess() }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{ items }\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\tsetNumber(value, type) {\n\t\tthis.props.setTime( type, parseInt( value, 10 ) );\n\t}\n\n\trenderCounter( type, value ) {\n\t\tif ( type === 'hours' && this.isAMPM() ) {\n\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\tif ( value === 0 ) {\n\t\t\t\tvalue = 12;\n\t\t\t}\n\t\t}\n\n\t\tif ( type === 'ampm' ) {\n\t\t\tif ( this.props.timeFormat.indexOf(' A') !== -1 ) {\n\t\t\t\tvalue = this.props.viewDate.format('A');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = this.props.viewDate.format('a');\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'increase', type)}>▲\n\t\t\t\t
\n\t\t\t\t\t{ (type !== 'ampm') ? (\n\t\t\t\t\t\t this.setNumber(value, type)}\n\t\t\t\t\t\t\tmin={timeConstraints[type].min}\n\t\t\t\t\t\t\tmax={timeConstraints[type].max}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : value }\n\t\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'decrease', type)}>▼\n\t\t\t
\n\t\t);\n\t}\n\n\trenderHeader() {\n\t\tif ( !this.props.dateFormat ) return;\n\n\t\tconst date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('days') }>\n\t\t\t\t\t\t{ date.format( this.props.dateFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\tonStartClicking( e, action, type ) {\n\t\tif ( e && e.button && e.button !== 0 ) {\n\t\t\t// Only left clicks, thanks\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( type === 'ampm' ) return this.toggleDayPart();\n\n\t\tlet update = {};\n\t\tlet body = document.body;\n\t\tupdate[ type ] = this[ action ]( type );\n\t\tthis.setState( update );\n\n\t\tthis.timer = setTimeout( () => {\n\t\t\tthis.increaseTimer = setInterval( () => {\n\t\t\t\tupdate[ type ] = this[ action ]( type );\n\t\t\t\tthis.setState( update );\n\t\t\t}, 70);\n\t\t}, 500);\n\n\t\tthis.mouseUpListener = () => {\n\t\t\tclearTimeout( this.timer );\n\t\t\tclearInterval( this.increaseTimer );\n\t\t\tthis.props.setTime( type, parseInt( this.state[ type ], 10 ) );\n\t\t\tbody.removeEventListener( 'mouseup', this.mouseUpListener );\n\t\t\tbody.removeEventListener( 'touchend', this.mouseUpListener );\n\t\t};\n\n\t\tbody.addEventListener( 'mouseup', this.mouseUpListener );\n\t\tbody.addEventListener( 'touchend', this.mouseUpListener );\n\t}\n\n\ttoggleDayPart() {\n\t\tlet hours = parseInt( this.state.hours, 10 );\n\t\t\n\t\tif ( hours >= 12 ) {\n\t\t\thours -= 12;\n\t\t}\n\t\telse {\n\t\t\thours += 12;\n\t\t}\n\n\t\tthis.props.setTime( 'hours', hours );\n\t}\n\n\tincrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) + tc.step;\n\t\tif ( value > tc.max )\n\t\t\tvalue = tc.min + ( value - ( tc.max + 1 ) );\n\t\treturn pad( type, value );\n\t}\n\n\tdecrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) - tc.step;\n\t\tif ( value < tc.min )\n\t\t\tvalue = tc.max + 1 - ( tc.min - value );\n\t\treturn pad( type, value );\n\t}\n\n\tgetCounters() {\n\t\tlet counters = [];\n\t\tlet format = this.props.timeCountersFormat || this.props.timeFormat;\n\t\t\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t\tif ( format.indexOf('S') !== -1 ) {\n\t\t\t\t\t\tcounters.push('milliseconds');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.isAMPM() ) {\n\t\t\tcounters.push('ampm');\n\t\t}\n\n\t\treturn counters;\n\t}\n\n\tisAMPM() {\n\t\treturn this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1;\n\t}\n\n\tgetTimeParts( date ) {\n\t\tconst hours = date.hours();\n\n\t\treturn {\n\t\t\thours: pad( 'hours', hours ),\n\t\t\tminutes: pad( 'minutes', date.minutes() ),\n\t\t\tseconds: pad( 'seconds', date.seconds() ),\n\t\t\tmilliseconds: pad('milliseconds', date.milliseconds() ),\n\t\t\tampm: hours < 12 ? 'am' : 'pm'\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.selectedDate ) {\n\t\t\tif ( this.props.selectedDate !== prevProps.selectedDate ) {\n\t\t\t\tthis.setState( this.getTimeParts( this.props.selectedDate ) );\n\t\t\t}\n\t\t}\n\t\telse if ( prevProps.viewDate !== this.props.viewDate ) {\n\t\t\tthis.setState( this.getTimeParts( this.props.viewDate ) );\n\t\t}\n\t}\n}\n\nfunction pad( type, value ) {\n\tconst padValues = {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t};\n\n\tlet str = value + '';\n\twhile ( str.length < padValues[ type ] )\n\t\tstr = '0' + str;\n\treturn str;\n}\n","import {createElement,Component}from'react';import {findDOMNode}from'react-dom';function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n // Also cover shadowRoot node by checking current.host\n\n\n while (current.parentNode || current.host) {\n // Only check normal node without shadowRoot\n if (current.parentNode && isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode || current.host;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};function autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();var passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class = /*#__PURE__*/function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n }\n /**\n * Remove all document's event listeners for this component\n */\n ;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n }\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n ;\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _this$props = this.props;\n _this$props.excludeScrollbar;\n var props = _objectWithoutPropertiesLoose(_this$props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}export default onClickOutsideHOC;export{IGNORE_CLASS_NAME};","import PropTypes from 'prop-types';\nimport moment from 'moment';\nimport React from 'react';\nimport DaysView from './views/DaysView';\nimport MonthsView from './views/MonthsView';\nimport YearsView from './views/YearsView';\nimport TimeView from './views/TimeView';\nimport onClickOutside from 'react-onclickoutside';\n\nconst viewModes = {\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n};\n\nconst TYPES = PropTypes;\nconst nofn = function () {};\nconst datetype = TYPES.oneOfType([ TYPES.instanceOf(moment), TYPES.instanceOf(Date), TYPES.string ]);\n\nexport default class Datetime extends React.Component {\n\tstatic propTypes = {\n\t\tvalue: datetype,\n\t\tinitialValue: datetype,\n\t\tinitialViewDate: datetype,\n\t\tinitialViewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tonOpen: TYPES.func,\n\t\tonClose: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonNavigate: TYPES.func,\n\t\tonBeforeNavigate: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tupdateOnView: TYPES.string,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\tdisplayTimeFirst: TYPES.bool,\n\t\tshowTimeZone: TYPES.bool,\n\t\tdateFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\ttimeFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool,\n\t\trenderView: TYPES.func,\n\t\trenderInput: TYPES.func,\n\t\trenderDay: TYPES.func,\n\t\trenderMonth: TYPES.func,\n\t\trenderYear: TYPES.func,\n\t}\n\n\tstatic defaultProps = {\n\t\tonOpen: nofn,\n\t\tonClose: nofn,\n\t\tonCalendarOpen: nofn,\n\t\tonCalendarClose: nofn,\n\t\tonChange: nofn,\n\t\tonNavigate: nofn,\n\t\tonBeforeNavigate: function(next) { return next; }, \n\t\tonNavigateBack: nofn,\n\t\tonNavigateForward: nofn,\n\t\tdateFormat: true,\n\t\ttimeFormat: true,\n\t\tutc: false,\n\t\tclassName: '',\n\t\tinput: true,\n\t\tinputProps: {},\n\t\ttimeConstraints: {},\n\t\tisValidDate: function() { return true; },\n\t\tstrictParsing: true,\n\t\tcloseOnSelect: false,\n\t\tcloseOnTab: true,\n\t\tcloseOnClickOutside: true,\n\t\trenderView: ( _, renderFunc ) => renderFunc(),\n\t}\n\n\t// Make moment accessible through the Datetime class\n\tstatic moment = moment;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = this.getInitialState();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.renderInput() }\n\t\t\t\t
\n\t\t\t\t\t{ this.renderView() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif ( !this.props.input ) return;\n\n\t\tconst finalInputProps = {\n\t\t\ttype: 'text',\n\t\t\tclassName: 'form-control',\n\t\t\tvalue: this.getInputValue(),\n\t\t\t...this.props.inputProps,\n\t\t\tonFocus: this._onInputFocus,\n\t\t\tonChange: this._onInputChange,\n\t\t\tonKeyDown: this._onInputKeyDown,\n\t\t\tonClick: this._onInputClick\n\t\t};\n\n\t\tif ( this.props.renderInput ) { \n\t\t\treturn (\n\t\t\t\t
\n\t\t\t\t\t{ this.props.renderInput( finalInputProps, this._openCalendar, this._closeCalendar ) }\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n\n\trenderView() {\n\t\treturn this.props.renderView( this.state.currentView, this._renderCalendar );\n\t}\n\n\t_renderCalendar = () => {\n\t\tconst props = this.props;\n\t\tconst state = this.state;\n\n\t\tlet viewProps = {\n\t\t\tviewDate: state.viewDate.clone(),\n\t\t\tselectedDate: this.getSelectedDate(),\n\t\t\tisValidDate: props.isValidDate,\n\t\t\tupdateDate: this._updateDate,\n\t\t\tnavigate: this._viewNavigate,\n\t\t\tmoment: moment,\n\t\t\tshowView: this._showView,\n\t\t\tdisplayTimeZone: props.displayTimeZone,\n\t\t\tshowTimeZone: props.showTimeZone,\n\t\t\ttimeCountersFormat: props.timeCountersFormat,\n\t\t};\n\n\t\t// Probably updateOn, updateSelectedDate and setDate can be merged in the same method\n\t\t// that would update viewDate or selectedDate depending on the view and the dateFormat\n\t\tswitch ( state.currentView ) {\n\t\t\tcase viewModes.YEARS:\n\t\t\t\t// Used viewProps\n\t\t\t\t// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderYear = props.renderYear;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.MONTHS:\n\t\t\t\t// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderMonth = props.renderMonth;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.DAYS:\n\t\t\t\t// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat \n\t\t\t\tviewProps.renderDay = props.renderDay;\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t// { viewDate, selectedDate, timeFormat, dateFormat, timeConstraints, setTime, showView }\n\t\t\t\tviewProps.dateFormat = this.getFormat('date');\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\tviewProps.timeConstraints = props.timeConstraints;\n\t\t\t\tviewProps.setTime = this._setTime;\n\t\t\t\treturn ;\n\t\t}\n\t}\n\n\tgetInitialState() {\n\t\tlet props = this.props;\n\t\tlet inputFormat = this.getFormat('datetime');\n\t\tlet selectedDate = this.parseDate( props.value || props.initialValue, inputFormat );\n\n\t\tthis.checkTZ();\n\n\t\treturn {\n\t\t\topen: !props.input,\n\t\t\tcurrentView: props.initialViewMode || this.getInitialView(),\n\t\t\tviewDate: this.getInitialViewDate( selectedDate ),\n\t\t\tselectedDate: selectedDate && selectedDate.isValid() ? selectedDate : undefined,\n\t\t\tinputValue: this.getInitialInputValue( selectedDate )\n\t\t};\n\t}\n\t\n\tgetInitialViewDate( selectedDate ) {\n\t\tconst propDate = this.props.initialViewDate;\n\t\tlet viewDate;\n\t\tif ( propDate ) {\n\t\t\tviewDate = this.parseDate( propDate, this.getFormat('datetime') );\n\t\t\tif ( viewDate && viewDate.isValid() ) {\n\t\t\t\treturn viewDate;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog('The initialViewDated given \"' + propDate + '\" is not valid. Using current date instead.');\n\t\t\t}\n\t\t}\n\t\telse if ( selectedDate && selectedDate.isValid() ) {\n\t\t\treturn selectedDate.clone();\n\t\t}\n\t\treturn this.getInitialDate();\n\t}\n\n\tgetInitialDate() {\n\t\tlet m = this.localMoment();\n\t\tm.hour(0).minute(0).second(0).millisecond(0);\n\t\treturn m;\n\t}\n\n\tgetInitialView() {\n\t\tconst dateFormat = this.getFormat( 'date' );\n\t\treturn dateFormat ? this.getUpdateOn( dateFormat ) : viewModes.TIME;\n\t}\n\n\tparseDate(date, dateFormat) {\n\t\tlet parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, dateFormat);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t}\n\n\tgetClassName() {\n\t\tlet cn = 'rdt';\n\t\tlet props = this.props;\n\t\tlet propCn = props.className;\n\n\t\tif ( Array.isArray( propCn ) ) {\n\t\t\tcn += ' ' + propCn.join(' ');\n\t\t}\n\t\telse if ( propCn ) {\n\t\t\tcn += ' ' + propCn;\n\t\t}\n\n\t\tif ( !props.input ) {\n\t\t\tcn += ' rdtStatic';\n\t\t}\n\t\tif ( this.isOpen() ) {\n\t\t\tcn += ' rdtOpen';\n\t\t}\n\n\t\treturn cn;\n\t}\n\t\n\tisOpen() {\n\t\treturn !this.props.input || (this.props.open === undefined ? this.state.open : this.props.open);\n\t}\n\n\tgetUpdateOn( dateFormat ) {\n\t\tif ( this.props.updateOnView ) {\n\t\t\treturn this.props.updateOnView;\n\t\t}\n\n\t\tif ( dateFormat.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t}\n\n\tgetLocaleData() {\n\t\tlet p = this.props;\n\t\treturn this.localMoment( p.value || p.defaultValue || new Date() ).localeData();\n\t}\n\n\tgetDateFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.dateFormat;\n\t\tif ( format === true ) return locale.longDateFormat('L');\n\t\tif ( format ) return format;\n\t\treturn '';\n\t}\n\n\tgetTimeFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.timeFormat;\n\t\tif ( format === true ) {\n\t\t\treturn locale.longDateFormat('LT');\n\t\t}\n\t\treturn format || '';\n\t}\n\n\tgetFormat( type ) {\n\t\tif ( type === 'date' ) {\n\t\t\treturn this.getDateFormat();\n\t\t}\n\t\telse if ( type === 'time' ) {\n\t\t\treturn this.getTimeFormat();\n\t\t}\n\t\t\n\t\tlet dateFormat = this.getDateFormat();\n\t\tlet timeFormat = this.getTimeFormat();\n\t\tconst combinedDateTimeFormat = this.props.showTimeFirst ? `${timeFormat} ${dateFormat}` : `${dateFormat} ${timeFormat}`;\n\t\treturn dateFormat && timeFormat ? combinedDateTimeFormat : (dateFormat || timeFormat );\n\t}\n\n\t_showView = ( view, date ) => {\n\t\tconst d = ( date || this.state.viewDate ).clone();\n\t\tconst nextView = this.props.onBeforeNavigate( view, this.state.currentView, d );\n\n\t\tif ( nextView && this.state.currentView !== nextView ) {\n\t\t\tthis.props.onNavigate( nextView );\n\t\t\tthis.setState({ currentView: nextView });\n\t\t}\n\t}\n\n\tupdateTime( op, amount, type, toSelected ) {\n\t\tlet update = {};\n\t\tconst date = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t}\n\n\tviewToMethod = {days: 'date', months: 'month', years: 'year'};\n\tnextView = { days: 'time', months: 'days', years: 'months'};\n\t_updateDate = e => {\n\t\tlet state = this.state;\n\t\tlet currentView = state.currentView;\n\t\tlet updateOnView = this.getUpdateOn( this.getFormat('date') );\n\t\tlet viewDate = this.state.viewDate.clone();\n\n\t\t// Set the value into day/month/year\n\t\tviewDate[ this.viewToMethod[currentView] ](\n\t\t\tparseInt( e.target.getAttribute('data-value'), 10 )\n\t\t);\n\n\t\t// Need to set month and year will for days view (prev/next month)\n\t\tif ( currentView === 'days' ) {\n\t\t\tviewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );\n\t\t\tviewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );\n\t\t}\n\n\t\tlet update = {viewDate: viewDate};\n\t\tif ( currentView === updateOnView ) {\n\t\t\tupdate.selectedDate = viewDate.clone();\n\t\t\tupdate.inputValue = viewDate.format( this.getFormat('datetime') );\n\n\t\t\tif ( this.props.open === undefined && this.props.input && this.props.closeOnSelect ) {\n\t\t\t\tthis._closeCalendar();\n\t\t\t}\n\n\t\t\tthis.props.onChange( viewDate.clone() );\n\t\t}\n\t\telse {\n\t\t\tthis._showView( this.nextView[ currentView ], viewDate );\n\t\t}\n\n\t\tthis.setState( update );\n\t}\n\n\t_viewNavigate = ( modifier, unit ) => {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\t\n\t\t// Subtracting is just adding negative time\n\t\tviewDate.add( modifier, unit );\n\n\t\tif ( modifier > 0 ) {\n\t\t\tthis.props.onNavigateForward( modifier, unit );\n\t\t}\n\t\telse {\n\t\t\tthis.props.onNavigateBack( -(modifier), unit );\n\t\t}\n\n\t\tthis.setState({viewDate});\n\t}\n\t\n\t_setTime = ( type, value ) => {\n\t\tlet date = (this.getSelectedDate() || this.state.viewDate).clone();\n\t\t\n\t\tdate[ type ]( value );\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone(),\n\t\t\t\tinputValue: date.format( this.getFormat('datetime') )\n\t\t\t});\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t}\n\n\t_openCalendar = () => {\n\t\tif ( this.isOpen() ) return;\n\t\tthis.setState({open: true}, this.props.onOpen );\n\t}\n\n\t_closeCalendar = () => {\n\t\tif ( !this.isOpen() ) return;\n\n\t\tthis.setState({open: false}, () => {\n\t\t\t this.props.onClose( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t}\n\n\t_handleClickOutside = () => {\n\t\tlet props = this.props;\n\n\t\tif ( props.input && this.state.open && props.open === undefined && props.closeOnClickOutside ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\tlocalMoment( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tlet m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t}\n\n\tcheckTZ() {\n\t\tconst { displayTimeZone } = this.props;\n\t\tif ( displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tlog('displayTimeZone prop with value \"' + displayTimeZone + '\" is used but moment.js timezone is not loaded.', 'error');\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( prevProps === this.props ) return;\n\n\t\tlet needsUpdate = false;\n\t\tlet thisProps = this.props;\n\n\t\t['locale', 'utc', 'displayZone', 'dateFormat', 'timeFormat'].forEach( function(p) {\n\t\t\tprevProps[p] !== thisProps[p] && (needsUpdate = true);\n\t\t});\n\n\t\tif ( needsUpdate ) {\n\t\t\tthis.regenerateDates();\n\t\t}\n\n\t\tif ( thisProps.value && thisProps.value !== prevProps.value ) {\n\t\t\tthis.setViewDate( thisProps.value );\n\t\t}\n\n\t\tthis.checkTZ();\n\t}\n\n\tregenerateDates() {\n\t\tconst props = this.props;\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\tlet selectedDate = this.state.selectedDate && this.state.selectedDate.clone();\n\n\t\tif ( props.locale ) {\n\t\t\tviewDate.locale( props.locale );\n\t\t\tselectedDate &&\tselectedDate.locale( props.locale );\n\t\t}\n\t\tif ( props.utc ) {\n\t\t\tviewDate.utc();\n\t\t\tselectedDate &&\tselectedDate.utc();\n\t\t}\n\t\telse if ( props.displayTimeZone ) {\n\t\t\tviewDate.tz( props.displayTimeZone );\n\t\t\tselectedDate &&\tselectedDate.tz( props.displayTimeZone );\n\t\t}\n\t\telse {\n\t\t\tviewDate.locale();\n\t\t\tselectedDate &&\tselectedDate.locale();\n\t\t}\n\n\t\tlet update = { viewDate: viewDate, selectedDate: selectedDate};\n\t\tif ( selectedDate && selectedDate.isValid() ) {\n\t\t\tupdate.inputValue = selectedDate.format( this.getFormat('datetime') );\n\t\t}\n\t\tthis.setState( update );\n\t}\n\n\tgetSelectedDate() {\n\t\tif ( this.props.value === undefined ) return this.state.selectedDate;\n\t\tlet selectedDate = this.parseDate( this.props.value, this.getFormat('datetime') );\n\t\treturn selectedDate && selectedDate.isValid() ? selectedDate : false;\n\t}\n\n\tgetInitialInputValue( selectedDate ) {\n\t\tconst props = this.props;\n\t\tif ( props.inputProps.value )\n\t\t\treturn props.inputProps.value;\n\t\t\n\t\tif ( selectedDate && selectedDate.isValid() )\n\t\t\treturn selectedDate.format( this.getFormat('datetime') );\n\t\t\n\t\tif ( props.value && typeof props.value === 'string' )\n\t\t\treturn props.value;\n\t\t\n\t\tif ( props.initialValue && typeof props.initialValue === 'string' )\n\t\t\treturn props.initialValue;\n\t\t\n\t\treturn '';\n\t}\n\n\tgetInputValue() {\n\t\treturn this.state.inputValue;\n\t}\n\n\t/**\n\t * Set the date that is currently shown in the calendar.\n\t * This is independent from the selected date and it's the one used to navigate through months or days in the calendar.\n\t * @param dateType date\n\t * @public\n\t */\n\tsetViewDate( date ) {\n\t\tlet logError = function() {\n\t\t\treturn log( 'Invalid date passed to the `setViewDate` method: ' + date );\n\t\t};\n\n\t\tif ( !date ) return logError();\n\t\t\n\t\tlet viewDate;\n\t\tif ( typeof date === 'string' ) {\n\t\t\tviewDate = this.localMoment(date, this.getFormat('datetime') );\n\t\t}\n\t\telse {\n\t\t\tviewDate = this.localMoment( date );\n\t\t}\n\n\t\tif ( !viewDate || !viewDate.isValid() ) return logError();\n\t\tlet selectedDate = this.getSelectedDate();\n\t\tthis.setState({\n\t\t\tviewDate: viewDate,\n\t\t\tinputValue: selectedDate ? selectedDate.format( this.getFormat('datetime') ) : this.state.inputValue,\n\t\t});\n\t}\n\n\t/**\n\t * Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.\n\t * @param TYPES.string mode \n\t */\n\tnavigate( mode ) {\n\t\tthis._showView( mode );\n\t}\n\n\t_onInputFocus = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onFocus, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\t_onInputChange = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onChange, e ) ) return;\n\n\t\tconst value = e.target ? e.target.value : e;\n\t\tconst localMoment = this.localMoment( value, this.getFormat('datetime') );\n\t\tlet update = { inputValue: value };\n\n\t\tif ( localMoment.isValid() ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t}\n\t\telse {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\tthis.setState( update, () => {\n\t\t\tthis.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t}\n\n\t_onInputKeyDown = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onKeyDown, e ) ) return;\n\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\t_onInputClick = e => {\n\t\t// Focus event should open the calendar, but there is some case where\n\t\t// the input is already focused and the picker is closed, so clicking the input\n\t\t// should open it again see https://github.com/arqex/react-datetime/issues/717\n\t\tif ( !this.callHandler( this.props.inputProps.onClick, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\tcallHandler( method, e ) {\n\t\tif ( !method ) return true;\n\t\treturn method(e) !== false;\n\t}\n}\n\nfunction log( message, method ) {\n\tlet con = typeof window !== 'undefined' && window.console;\n\tif ( !con ) return;\n\n\tif ( !method ) {\n\t\tmethod = 'warn';\n\t}\n\tcon[ method ]( '***react-datetime:' + message );\n}\n\nclass ClickOutBase extends React.Component {\n\tcontainer = React.createRef();\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t{ this.props.children }\n\t\t\t
\n\t\t);\n\t}\n\thandleClickOutside(e) {\n\t\tthis.props.onClickOut( e );\n\t}\n\n\tsetClickOutsideRef() {\n\t\treturn this.container.current;\n\t}\n}\n\nconst ClickableWrapper = onClickOutside( ClickOutBase );\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/react-datetime.umd.js b/dist/react-datetime.umd.js index 8769a05aa..ca143b5eb 100644 --- a/dist/react-datetime.umd.js +++ b/dist/react-datetime.umd.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("moment"),require("moment-timezone"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","moment","moment-timezone","react-dom"],t):"object"==typeof exports?exports.Datetime=t(require("react"),require("moment"),require("moment-timezone"),require("react-dom")):e.Datetime=t(e.react,e.moment,e["moment-timezone"],e["react-dom"])}(window,(function(e,t,n,r){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t,n){e.exports=n(6)()},function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";var r=n(7);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),a=n(1),i=n.n(a),s=n(0),c=n.n(s);function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t1;)if(t(n.date(r)))return!1;return!0}},{key:"getMonthText",value:function(e){var t,n=this.props.viewDate,r=n.localeData().monthsShort(n.month(e));return(t=r.substring(0,3)).charAt(0).toUpperCase()+t.slice(1)}}])&&C(t.prototype,n),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(c.a.Component);function N(e,t){return t<4?e[0]:t<8?e[1]:e[2]}function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var n=0;n1;)if(n(r.dayOfYear(o)))return t[e]=!1,!1;return t[e]=!0,!0}}])&&F(t.prototype,n),r&&F(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(c.a.Component);function H(e,t){return t<3?e[0]:t<7?e[1]:e[2]}B(Z,"defaultProps",{renderYear:function(e,t){return c.a.createElement("td",e,t)}});var U=n(2),z=n.n(U);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=r&&t<=o&&n(t)}),[n,o,r,u]);return c.a.createElement("input",{value:i,onChange:f,className:"rdtInput ".concat(l&&"invalid")})},ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K(e,t)}(a,e);var t,n,r,o=G(a);function a(e){var t,n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=o.call(this,e)).constraints=(n=e.timeConstraints,r={},Object.keys(re).forEach((function(e){r[e]=te(te({},re[e]),n[e]||{})})),r),t.state=t.getTimeParts(e.selectedDate||e.viewDate),t}return t=a,(n=[{key:"render",value:function(){var e=this,t=[],n=this.state;return this.getCounters().forEach((function(r,o){o&&"ampm"!==r&&t.push(c.a.createElement("div",{key:"sep".concat(o),className:"rdtCounterSeparator"},":")),t.push(e.renderCounter(r,n[r]))})),c.a.createElement("div",{className:"rdtTime"},c.a.createElement("table",null,this.renderHeader(),c.a.createElement("tbody",null,c.a.createElement("tr",null,c.a.createElement("td",null,c.a.createElement("div",{className:"rdtCounters"},t)))),this.props.showTimeZone&&c.a.createElement("div",{className:"timezone-display"},c.a.createElement("span",null,"(GMT",z.a.tz(this.props.displayTimeZone||z.a.tz.guess()).format("Z"),")"),c.a.createElement("span",null," "),c.a.createElement("span",null,this.props.displayTimeZone||z.a.tz.guess()))))}},{key:"setNumber",value:function(e,t){this.props.setTime(t,parseInt(e,10))}},{key:"renderCounter",value:function(e,t){var n=this;return"hours"===e&&this.isAMPM()&&0==(t=(t-1)%12+1)&&(t=12),"ampm"===e&&(t=-1!==this.props.timeFormat.indexOf(" A")?this.props.viewDate.format("A"):this.props.viewDate.format("a")),c.a.createElement("div",{key:e,className:"rdtCounter"},c.a.createElement("span",{className:"rdtBtn",onMouseDown:function(t){return n.onStartClicking(t,"increase",e)}},"▲"),c.a.createElement("div",{className:"rdtCount"},"ampm"!==e?c.a.createElement(oe,{value:t,onChange:function(t){return n.setNumber(t,e)},min:re[e].min,max:re[e].max}):t),c.a.createElement("span",{className:"rdtBtn",onMouseDown:function(t){return n.onStartClicking(t,"decrease",e)}},"▼"))}},{key:"renderHeader",value:function(){var e=this;if(this.props.dateFormat){var t=this.props.selectedDate||this.props.viewDate;return c.a.createElement("thead",null,c.a.createElement("tr",null,c.a.createElement("td",{className:"rdtSwitch",colSpan:"4",onClick:function(){return e.props.showView("days")}},t.format(this.props.dateFormat))))}}},{key:"onStartClicking",value:function(e,t,n){var r=this;if(!e||!e.button||0===e.button){if("ampm"===n)return this.toggleDayPart();var o={},a=document.body;o[n]=this[t](n),this.setState(o),this.timer=setTimeout((function(){r.increaseTimer=setInterval((function(){o[n]=r[t](n),r.setState(o)}),70)}),500),this.mouseUpListener=function(){clearTimeout(r.timer),clearInterval(r.increaseTimer),r.props.setTime(n,parseInt(r.state[n],10)),a.removeEventListener("mouseup",r.mouseUpListener),a.removeEventListener("touchend",r.mouseUpListener)},a.addEventListener("mouseup",this.mouseUpListener),a.addEventListener("touchend",this.mouseUpListener)}}},{key:"toggleDayPart",value:function(){var e=parseInt(this.state.hours,10);e>=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)+t.step;return n>t.max&&(n=t.min+(n-(t.max+1))),ie(e,n)}},{key:"decrease",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)-t.step;return n=0||(o[n]=e[n]);return o}(t,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(s.createElement)(e,n)},i}(s.Component),n.displayName="OnClickOutside("+o+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r};function ge(e){return(ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t0?r.props.onNavigateForward(e,t):r.props.onNavigateBack(-e,t),r.setState({viewDate:n})})),Ve(Se(r),"_setTime",(function(e,t){var n=(r.getSelectedDate()||r.state.viewDate).clone();n[e](t),r.props.value||r.setState({selectedDate:n,viewDate:n.clone(),inputValue:n.format(r.getFormat("datetime"))}),r.props.onChange(n)})),Ve(Se(r),"_openCalendar",(function(){r.isOpen()||r.setState({open:!0},r.props.onOpen)})),Ve(Se(r),"_closeCalendar",(function(){r.isOpen()&&r.setState({open:!1},(function(){r.props.onClose(r.state.selectedDate||r.state.inputValue)}))})),Ve(Se(r),"_handleClickOutside",(function(){var e=r.props;e.input&&r.state.open&&void 0===e.open&&e.closeOnClickOutside&&r._closeCalendar()})),Ve(Se(r),"_onInputFocus",(function(e){r.callHandler(r.props.inputProps.onFocus,e)&&r._openCalendar()})),Ve(Se(r),"_onInputChange",(function(e){if(r.callHandler(r.props.inputProps.onChange,e)){var t=e.target?e.target.value:e,n=r.localMoment(t,r.getFormat("datetime")),o={inputValue:t};n.isValid()?(o.selectedDate=n,o.viewDate=n.clone().startOf("month")):o.selectedDate=null,r.setState(o,(function(){r.props.onChange(n.isValid()?n:r.state.inputValue)}))}})),Ve(Se(r),"_onInputKeyDown",(function(e){r.callHandler(r.props.inputProps.onKeyDown,e)&&9===e.which&&r.props.closeOnTab&&r._closeCalendar()})),Ve(Se(r),"_onInputClick",(function(e){r.callHandler(r.props.inputProps.onClick,e)&&r._openCalendar()})),r.state=r.getInitialState(),r}return Ce(n,[{key:"render",value:function(){return c.a.createElement(Be,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),c.a.createElement("div",{className:"rdtPicker"},this.renderView()))}},{key:"renderInput",value:function(){if(this.props.input){var e=Oe(Oe({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?c.a.createElement("div",null,this.props.renderInput(e,this._openCalendar,this._closeCalendar)):c.a.createElement("input",e)}}},{key:"renderView",value:function(){return this.props.renderView(this.state.currentView,this._renderCalendar)}},{key:"getInitialState",value:function(){var e=this.props,t=this.getFormat("datetime"),n=this.parseDate(e.value||e.initialValue,t);return this.checkTZ(),{open:!e.input,currentView:e.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(n),selectedDate:n&&n.isValid()?n:void 0,inputValue:this.getInitialInputValue(n)}}},{key:"getInitialViewDate",value:function(e){var t,n=this.props.initialViewDate;if(n){if((t=this.parseDate(n,this.getFormat("datetime")))&&t.isValid())return t;Le('The initialViewDated given "'+n+'" is not valid. Using current date instead.')}else if(e&&e.isValid())return e.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var e=this.localMoment();return e.hour(0).minute(0).second(0).millisecond(0),e}},{key:"getInitialView",value:function(){var e=this.getFormat("date");return e?this.getUpdateOn(e):Fe}},{key:"parseDate",value:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n}},{key:"getClassName",value:function(){var e="rdt",t=this.props,n=t.className;return Array.isArray(n)?e+=" "+n.join(" "):n&&(e+=" "+n),t.input||(e+=" rdtStatic"),this.isOpen()&&(e+=" rdtOpen"),e}},{key:"isOpen",value:function(){return!this.props.input||(void 0===this.props.open?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(e){return this.props.updateOnView?this.props.updateOnView:e.match(/[lLD]/)?Ie:-1!==e.indexOf("M")?xe:-1!==e.indexOf("Y")?Ne:Ie}},{key:"getLocaleData",value:function(){var e=this.props;return this.localMoment(e.value||e.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(){var e=this.getLocaleData(),t=this.props.dateFormat;return!0===t?e.longDateFormat("L"):t||""}},{key:"getTimeFormat",value:function(){var e=this.getLocaleData(),t=this.props.timeFormat;return!0===t?e.longDateFormat("LT"):t||""}},{key:"getFormat",value:function(e){if("date"===e)return this.getDateFormat();if("time"===e)return this.getTimeFormat();var t=this.getDateFormat(),n=this.getTimeFormat(),r=this.props.showTimeFirst?"".concat(n," ").concat(t):"".concat(t," ").concat(n);return t&&n?r:t||n}},{key:"updateTime",value:function(e,t,n,r){var o={},a=r?"selectedDate":"viewDate";o[a]=this.state[a].clone()[e](t,n),this.setState(o)}},{key:"localMoment",value:function(e,t,n){var r=null;return r=(n=n||this.props).utc?i.a.utc(e,t,n.strictParsing):n.displayTimeZone?i.a.tz(e,t,n.displayTimeZone):i()(e,t,n.strictParsing),n.locale&&r.locale(n.locale),r}},{key:"checkTZ",value:function(){var e=this.props.displayTimeZone;!e||this.tzWarning||i.a.tz||(this.tzWarning=!0,Le('displayTimeZone prop with value "'+e+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(e){if(e!==this.props){var t=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach((function(r){e[r]!==n[r]&&(t=!0)})),t&&this.regenerateDates(),n.value&&n.value!==e.value&&this.setViewDate(n.value),this.checkTZ()}}},{key:"regenerateDates",value:function(){var e=this.props,t=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();e.locale&&(t.locale(e.locale),n&&n.locale(e.locale)),e.utc?(t.utc(),n&&n.utc()):e.displayTimeZone?(t.tz(e.displayTimeZone),n&&n.tz(e.displayTimeZone)):(t.locale(),n&&n.locale());var r={viewDate:t,selectedDate:n};n&&n.isValid()&&(r.inputValue=n.format(this.getFormat("datetime"))),this.setState(r)}},{key:"getSelectedDate",value:function(){if(void 0===this.props.value)return this.state.selectedDate;var e=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!e||!e.isValid())&&e}},{key:"getInitialInputValue",value:function(e){var t=this.props;return t.inputProps.value?t.inputProps.value:e&&e.isValid()?e.format(this.getFormat("datetime")):t.value&&"string"==typeof t.value?t.value:t.initialValue&&"string"==typeof t.initialValue?t.initialValue:""}},{key:"getInputValue",value:function(){return this.state.inputValue}},{key:"setViewDate",value:function(e){var t,n=function(){return Le("Invalid date passed to the `setViewDate` method: "+e)};if(!e)return n();if(!(t="string"==typeof e?this.localMoment(e,this.getFormat("datetime")):this.localMoment(e))||!t.isValid())return n();var r=this.getSelectedDate();this.setState({viewDate:t,inputValue:r?r.format(this.getFormat("datetime")):this.state.inputValue})}},{key:"navigate",value:function(e){this._showView(e)}},{key:"callHandler",value:function(e,t){return!e||!1!==e(t)}}]),n}(c.a.Component);function Le(e,t){var n="undefined"!=typeof window&&window.console;n&&(t||(t="warn"),n[t]("***react-datetime:"+e))}Ve(Ae,"propTypes",{value:Ye,initialValue:Ye,initialViewDate:Ye,initialViewMode:Me.oneOf([Ne,xe,Ie,Fe]),onOpen:Me.func,onClose:Me.func,onChange:Me.func,onNavigate:Me.func,onBeforeNavigate:Me.func,onNavigateBack:Me.func,onNavigateForward:Me.func,updateOnView:Me.string,locale:Me.string,utc:Me.bool,displayTimeZone:Me.string,input:Me.bool,displayTimeFirst:Me.bool,showTimeZone:Me.bool,dateFormat:Me.oneOfType([Me.string,Me.bool]),timeFormat:Me.oneOfType([Me.string,Me.bool]),inputProps:Me.object,timeConstraints:Me.object,isValidDate:Me.func,open:Me.bool,strictParsing:Me.bool,closeOnSelect:Me.bool,closeOnTab:Me.bool,renderView:Me.func,renderInput:Me.func,renderDay:Me.func,renderMonth:Me.func,renderYear:Me.func}),Ve(Ae,"defaultProps",{onOpen:Re,onClose:Re,onCalendarOpen:Re,onCalendarClose:Re,onChange:Re,onNavigate:Re,onBeforeNavigate:function(e){return e},onNavigateBack:Re,onNavigateForward:Re,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:function(e,t){return t()}}),Ve(Ae,"moment",i.a);var Be=be(function(e){Pe(n,e);var t=Ee(n);function n(){var e;De(this,n);for(var r=arguments.length,o=new Array(r),a=0;a1;)if(t(n.date(r)))return!1;return!0}},{key:"getMonthText",value:function(e){var t,n=this.props.viewDate,r=n.localeData().monthsShort(n.month(e));return(t=r.substring(0,3)).charAt(0).toUpperCase()+t.slice(1)}}])&&C(t.prototype,n),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(c.a.Component);function N(e,t){return t<4?e[0]:t<8?e[1]:e[2]}function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var n=0;n1;)if(n(r.dayOfYear(o)))return t[e]=!1,!1;return t[e]=!0,!0}}])&&F(t.prototype,n),r&&F(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(c.a.Component);function H(e,t){return t<3?e[0]:t<7?e[1]:e[2]}B(Z,"defaultProps",{renderYear:function(e,t){return c.a.createElement("td",e,t)}});var U=n(2),z=n.n(U);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=r&&t<=o&&n(t)}),[n,o,r,u]);return c.a.createElement("input",{value:i,onChange:f,className:"rdtInput ".concat(l&&"invalid")})},ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K(e,t)}(a,e);var t,n,r,o=G(a);function a(e){var t,n,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=o.call(this,e)).constraints=(n=e.timeConstraints,r={},Object.keys(re).forEach((function(e){r[e]=te(te({},re[e]),n[e]||{})})),r),t.state=t.getTimeParts(e.selectedDate||e.viewDate),t}return t=a,(n=[{key:"render",value:function(){var e=this,t=[],n=this.state;return this.getCounters().forEach((function(r,o){o&&"ampm"!==r&&t.push(c.a.createElement("div",{key:"sep".concat(o),className:"rdtCounterSeparator"},":")),t.push(e.renderCounter(r,n[r]))})),c.a.createElement("div",{className:"rdtTime"},c.a.createElement("table",null,this.renderHeader(),c.a.createElement("tbody",null,c.a.createElement("tr",null,c.a.createElement("td",null,c.a.createElement("div",{className:"rdtCounters"},t)))),this.props.showTimeZone&&c.a.createElement("div",{className:"timezone-display"},c.a.createElement("span",null,"(GMT",z.a.tz(this.props.displayTimeZone||z.a.tz.guess()).format("Z"),")"),c.a.createElement("span",null," "),c.a.createElement("span",null,this.props.displayTimeZone||z.a.tz.guess()))))}},{key:"setNumber",value:function(e,t){this.props.setTime(t,parseInt(e,10))}},{key:"renderCounter",value:function(e,t){var n=this;return"hours"===e&&this.isAMPM()&&0==(t=(t-1)%12+1)&&(t=12),"ampm"===e&&(t=-1!==this.props.timeFormat.indexOf(" A")?this.props.viewDate.format("A"):this.props.viewDate.format("a")),c.a.createElement("div",{key:e,className:"rdtCounter"},c.a.createElement("span",{className:"rdtBtn",onMouseDown:function(t){return n.onStartClicking(t,"increase",e)}},"▲"),c.a.createElement("div",{className:"rdtCount"},"ampm"!==e?c.a.createElement(oe,{value:t,onChange:function(t){return n.setNumber(t,e)},min:re[e].min,max:re[e].max}):t),c.a.createElement("span",{className:"rdtBtn",onMouseDown:function(t){return n.onStartClicking(t,"decrease",e)}},"▼"))}},{key:"renderHeader",value:function(){var e=this;if(this.props.dateFormat){var t=this.props.selectedDate||this.props.viewDate;return c.a.createElement("thead",null,c.a.createElement("tr",null,c.a.createElement("td",{className:"rdtSwitch",colSpan:"4",onClick:function(){return e.props.showView("days")}},t.format(this.props.dateFormat))))}}},{key:"onStartClicking",value:function(e,t,n){var r=this;if(!e||!e.button||0===e.button){if("ampm"===n)return this.toggleDayPart();var o={},a=document.body;o[n]=this[t](n),this.setState(o),this.timer=setTimeout((function(){r.increaseTimer=setInterval((function(){o[n]=r[t](n),r.setState(o)}),70)}),500),this.mouseUpListener=function(){clearTimeout(r.timer),clearInterval(r.increaseTimer),r.props.setTime(n,parseInt(r.state[n],10)),a.removeEventListener("mouseup",r.mouseUpListener),a.removeEventListener("touchend",r.mouseUpListener)},a.addEventListener("mouseup",this.mouseUpListener),a.addEventListener("touchend",this.mouseUpListener)}}},{key:"toggleDayPart",value:function(){var e=parseInt(this.state.hours,10);e>=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)+t.step;return n>t.max&&(n=t.min+(n-(t.max+1))),ie(e,n)}},{key:"decrease",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)-t.step;return n=0||(o[n]=e[n]);return o}(t,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(s.createElement)(e,n)},i}(s.Component),n.displayName="OnClickOutside("+o+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r};function ge(e){return(ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t0?r.props.onNavigateForward(e,t):r.props.onNavigateBack(-e,t),r.setState({viewDate:n})})),Ve(Se(r),"_setTime",(function(e,t){var n=(r.getSelectedDate()||r.state.viewDate).clone();n[e](t),r.props.value||r.setState({selectedDate:n,viewDate:n.clone(),inputValue:n.format(r.getFormat("datetime"))}),r.props.onChange(n)})),Ve(Se(r),"_openCalendar",(function(){r.isOpen()||r.setState({open:!0},r.props.onOpen)})),Ve(Se(r),"_closeCalendar",(function(){r.isOpen()&&r.setState({open:!1},(function(){r.props.onClose(r.state.selectedDate||r.state.inputValue)}))})),Ve(Se(r),"_handleClickOutside",(function(){var e=r.props;e.input&&r.state.open&&void 0===e.open&&e.closeOnClickOutside&&r._closeCalendar()})),Ve(Se(r),"_onInputFocus",(function(e){r.callHandler(r.props.inputProps.onFocus,e)&&r._openCalendar()})),Ve(Se(r),"_onInputChange",(function(e){if(r.callHandler(r.props.inputProps.onChange,e)){var t=e.target?e.target.value:e,n=r.localMoment(t,r.getFormat("datetime")),o={inputValue:t};n.isValid()?(o.selectedDate=n,o.viewDate=n.clone().startOf("month")):o.selectedDate=null,r.setState(o,(function(){r.props.onChange(n.isValid()?n:r.state.inputValue)}))}})),Ve(Se(r),"_onInputKeyDown",(function(e){r.callHandler(r.props.inputProps.onKeyDown,e)&&9===e.which&&r.props.closeOnTab&&r._closeCalendar()})),Ve(Se(r),"_onInputClick",(function(e){r.callHandler(r.props.inputProps.onClick,e)&&r._openCalendar()})),r.state=r.getInitialState(),r}return Ce(n,[{key:"render",value:function(){return c.a.createElement(Be,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),c.a.createElement("div",{className:"rdtPicker"},this.renderView()))}},{key:"renderInput",value:function(){if(this.props.input){var e=Oe(Oe({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?c.a.createElement("div",null,this.props.renderInput(e,this._openCalendar,this._closeCalendar)):c.a.createElement("input",e)}}},{key:"renderView",value:function(){return this.props.renderView(this.state.currentView,this._renderCalendar)}},{key:"getInitialState",value:function(){var e=this.props,t=this.getFormat("datetime"),n=this.parseDate(e.value||e.initialValue,t);return this.checkTZ(),{open:!e.input,currentView:e.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(n),selectedDate:n&&n.isValid()?n:void 0,inputValue:this.getInitialInputValue(n)}}},{key:"getInitialViewDate",value:function(e){var t,n=this.props.initialViewDate;if(n){if((t=this.parseDate(n,this.getFormat("datetime")))&&t.isValid())return t;Le('The initialViewDated given "'+n+'" is not valid. Using current date instead.')}else if(e&&e.isValid())return e.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var e=this.localMoment();return e.hour(0).minute(0).second(0).millisecond(0),e}},{key:"getInitialView",value:function(){var e=this.getFormat("date");return e?this.getUpdateOn(e):Fe}},{key:"parseDate",value:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n}},{key:"getClassName",value:function(){var e="rdt",t=this.props,n=t.className;return Array.isArray(n)?e+=" "+n.join(" "):n&&(e+=" "+n),t.input||(e+=" rdtStatic"),this.isOpen()&&(e+=" rdtOpen"),e}},{key:"isOpen",value:function(){return!this.props.input||(void 0===this.props.open?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(e){return this.props.updateOnView?this.props.updateOnView:e.match(/[lLD]/)?Ie:-1!==e.indexOf("M")?xe:-1!==e.indexOf("Y")?Ne:Ie}},{key:"getLocaleData",value:function(){var e=this.props;return this.localMoment(e.value||e.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(){var e=this.getLocaleData(),t=this.props.dateFormat;return!0===t?e.longDateFormat("L"):t||""}},{key:"getTimeFormat",value:function(){var e=this.getLocaleData(),t=this.props.timeFormat;return!0===t?e.longDateFormat("LT"):t||""}},{key:"getFormat",value:function(e){if("date"===e)return this.getDateFormat();if("time"===e)return this.getTimeFormat();var t=this.getDateFormat(),n=this.getTimeFormat(),r=this.props.showTimeFirst?"".concat(n," ").concat(t):"".concat(t," ").concat(n);return t&&n?r:t||n}},{key:"updateTime",value:function(e,t,n,r){var o={},a=r?"selectedDate":"viewDate";o[a]=this.state[a].clone()[e](t,n),this.setState(o)}},{key:"localMoment",value:function(e,t,n){var r=null;return r=(n=n||this.props).utc?i.a.utc(e,t,n.strictParsing):n.displayTimeZone?i.a.tz(e,t,n.displayTimeZone):i()(e,t,n.strictParsing),n.locale&&r.locale(n.locale),r}},{key:"checkTZ",value:function(){var e=this.props.displayTimeZone;!e||this.tzWarning||i.a.tz||(this.tzWarning=!0,Le('displayTimeZone prop with value "'+e+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(e){if(e!==this.props){var t=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach((function(r){e[r]!==n[r]&&(t=!0)})),t&&this.regenerateDates(),n.value&&n.value!==e.value&&this.setViewDate(n.value),this.checkTZ()}}},{key:"regenerateDates",value:function(){var e=this.props,t=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();e.locale&&(t.locale(e.locale),n&&n.locale(e.locale)),e.utc?(t.utc(),n&&n.utc()):e.displayTimeZone?(t.tz(e.displayTimeZone),n&&n.tz(e.displayTimeZone)):(t.locale(),n&&n.locale());var r={viewDate:t,selectedDate:n};n&&n.isValid()&&(r.inputValue=n.format(this.getFormat("datetime"))),this.setState(r)}},{key:"getSelectedDate",value:function(){if(void 0===this.props.value)return this.state.selectedDate;var e=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!e||!e.isValid())&&e}},{key:"getInitialInputValue",value:function(e){var t=this.props;return t.inputProps.value?t.inputProps.value:e&&e.isValid()?e.format(this.getFormat("datetime")):t.value&&"string"==typeof t.value?t.value:t.initialValue&&"string"==typeof t.initialValue?t.initialValue:""}},{key:"getInputValue",value:function(){return this.state.inputValue}},{key:"setViewDate",value:function(e){var t,n=function(){return Le("Invalid date passed to the `setViewDate` method: "+e)};if(!e)return n();if(!(t="string"==typeof e?this.localMoment(e,this.getFormat("datetime")):this.localMoment(e))||!t.isValid())return n();var r=this.getSelectedDate();this.setState({viewDate:t,inputValue:r?r.format(this.getFormat("datetime")):this.state.inputValue})}},{key:"navigate",value:function(e){this._showView(e)}},{key:"callHandler",value:function(e,t){return!e||!1!==e(t)}}]),n}(c.a.Component);function Le(e,t){var n="undefined"!=typeof window&&window.console;n&&(t||(t="warn"),n[t]("***react-datetime:"+e))}Ve(Ae,"propTypes",{value:Ye,initialValue:Ye,initialViewDate:Ye,initialViewMode:Me.oneOf([Ne,xe,Ie,Fe]),onOpen:Me.func,onClose:Me.func,onChange:Me.func,onNavigate:Me.func,onBeforeNavigate:Me.func,onNavigateBack:Me.func,onNavigateForward:Me.func,updateOnView:Me.string,locale:Me.string,utc:Me.bool,displayTimeZone:Me.string,input:Me.bool,displayTimeFirst:Me.bool,showTimeZone:Me.bool,dateFormat:Me.oneOfType([Me.string,Me.bool]),timeFormat:Me.oneOfType([Me.string,Me.bool]),inputProps:Me.object,timeConstraints:Me.object,isValidDate:Me.func,open:Me.bool,strictParsing:Me.bool,closeOnSelect:Me.bool,closeOnTab:Me.bool,renderView:Me.func,renderInput:Me.func,renderDay:Me.func,renderMonth:Me.func,renderYear:Me.func}),Ve(Ae,"defaultProps",{onOpen:Re,onClose:Re,onCalendarOpen:Re,onCalendarClose:Re,onChange:Re,onNavigate:Re,onBeforeNavigate:function(e){return e},onNavigateBack:Re,onNavigateForward:Re,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:function(e,t){return t()}}),Ve(Ae,"moment",i.a);var Be=be(function(e){Pe(n,e);var t=Ee(n);function n(){var e;De(this,n);for(var r=arguments.length,o=new Array(r),a=0;a\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{ switchContent }\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class DaysView extends React.Component {\n\tstatic defaultProps = {\n\t\tisValidDate: () => true,\n\t\trenderDay: ( props, date ) => { date.date() },\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\t{ this.renderDayHeaders() }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderDays() }\n\t\t\t\t\t\n\t\t\t\t\t{ this.renderFooter() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst date = this.props.viewDate;\n\t\tconst locale = date.localeData();\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'months' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'months' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'months' ) }\n\t\t\t\tswitchContent={ locale.months( date ) + ' ' + date.year() }\n\t\t\t\tswitchColSpan={5}\n\t\t\t\tswitchProps={ { 'data-value': this.props.viewDate.month() } }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderDayHeaders() {\n\t\tconst locale = this.props.viewDate.localeData();\n\t\tlet dayItems = getDaysOfWeek( locale ).map( (day, index) => (\n\t\t\t{ day }\n\t\t));\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ dayItems }\n\t\t\t\n\t\t);\n\t}\n\n\trenderDays() {\n\t\tconst date = this.props.viewDate;\n\t\tconst startOfMonth = date.clone().startOf('month');\n\t\tconst endOfMonth = date.clone().endOf('month');\n\n\t\t// We need 42 days in 6 rows\n\t\t// starting in the last week of the previous month\n\t\tlet rows = [[], [], [], [], [], []];\n\n\t\tlet startDate = date.clone().subtract( 1, 'months');\n\t\tstartDate.date( startDate.daysInMonth() ).startOf('week');\n\n\t\tlet endDate = startDate.clone().add( 42, 'd' );\n\t\tlet i = 0;\n\n\t\twhile ( startDate.isBefore( endDate ) ) {\n\t\t\tlet row = getRow( rows, i++ );\n\t\t\trow.push( this.renderDay( startDate, startOfMonth, endOfMonth ) );\n\t\t\tstartDate.add( 1, 'd' );\n\t\t}\n\n\t\treturn rows.map( (r, i) => (\n\t\t\t{ r }\n\t\t));\n\t}\n\n\trenderDay( date, startOfMonth, endOfMonth ) {\n\t\tlet selectedDate = this.props.selectedDate;\n\n\t\tlet dayProps = {\n\t\t\tkey: date.format('M_D'),\n\t\t\t'data-value': date.date(),\n\t\t\t'data-month': date.month(),\n\t\t\t'data-year': date.year()\n\t\t};\n\n\t\tlet className = 'rdtDay';\n\t\tif ( date.isBefore( startOfMonth ) ) {\n\t\t\tclassName += ' rdtOld';\n\t\t}\n\t\telse if ( date.isAfter( endOfMonth ) ) {\n\t\t\tclassName += ' rdtNew';\n\t\t}\n\t\tif ( selectedDate && date.isSame( selectedDate, 'day' ) ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\t\tif ( date.isSame( this.props.moment(), 'day' ) ) {\n\t\t\tclassName += ' rdtToday';\n\t\t}\n\n\t\tif ( this.props.isValidDate(date) ) {\n\t\t\tdayProps.onClick = this._setDate;\n\t\t}\n\t\telse {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\n\t\tdayProps.className = className;\n\n\t\treturn this.props.renderDay(\n\t\t\tdayProps, date.clone(), selectedDate && selectedDate.clone()\n\t\t);\n\t}\n\n\trenderFooter() {\n\t\tif ( !this.props.timeFormat ) return;\n\n\t\tconst date = this.props.viewDate;\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('time') }\n\t\t\t\t\t\tcolSpan={7}\n\t\t\t\t\t\tclassName=\"rdtTimeToggle\">\n\t\t\t\t\t\t{ date.format( this.props.timeFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t_setDate = e => {\n\t\tthis.props.updateDate( e );\n\t}\n}\n\nfunction getRow( rows, day ) {\n\treturn rows[ Math.floor( day / 7 ) ];\n}\n\n/**\n * Get a list of the days of the week\n * depending on the current locale\n * @return {array} A list with the shortname of the days\n */\nfunction getDaysOfWeek( locale ) {\n\tconst first = locale.firstDayOfWeek();\n\tlet dow = [];\n\tlet i = 0;\n\n\tlocale._weekdaysMin.forEach(function (day) {\n\t\tdow[(7 + (i++) - first) % 7] = day;\n\t});\n\n\treturn dow;\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class MonthsView extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderMonths() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tlet year = this.props.viewDate.year();\n\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'years' ) }\n\t\t\t\tswitchContent={ year }\n\t\t\t\tswitchColSpan=\"2\"\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderMonths() {\n\t\t// 12 months in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\n\t\tfor ( let month = 0; month < 12; month++ ) {\n\t\t\tlet row = getRow( rows, month );\n\n\t\t\trow.push( this.renderMonth( month ) );\n\t\t}\n\n\t\treturn rows.map( (months, i) => (\n\t\t\t{ months }\n\t\t));\n\t}\n\n\trenderMonth( month ) {\n\t\tconst selectedDate = this.props.selectedDate;\n\t\tlet className = 'rdtMonth';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledMonth( month ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedMonth;\n\t\t}\n\n\t\tif ( selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: month, className, 'data-value': month, onClick };\n\n\t\tif ( this.props.renderMonth ) {\n\t\t\treturn this.props.renderMonth(\n\t\t\t\tprops,\n\t\t\t\tmonth,\n\t\t\t\tthis.props.viewDate.year(),\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.getMonthText( month ) }\n\t\t\t\n\t\t);\n\t}\n\t\n\tisDisabledMonth( month ) {\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the month is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({month});\n\t\tlet day = date.endOf( 'month' ).date() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.date(day) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgetMonthText( month ) {\n\t\tconst localMoment = this.props.viewDate;\n\t\tconst monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\treturn capitalize( monthStr.substring( 0, 3 ) );\n\t}\n\n\t_updateSelectedMonth = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 4 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 8 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n\nfunction capitalize( str ) {\n\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class YearsView extends React.Component {\n\tstatic defaultProps = {\n\t\trenderYear: ( props, year ) => { year },\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderYears() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst viewYear = this.getViewYear();\n\t\treturn (\n\t\t\t this.props.navigate( -10, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 10, 'years' ) }\n\t\t\t\tswitchContent={ `${viewYear}-${viewYear + 9}` }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderYears() {\n\t\tconst viewYear = this.getViewYear();\n\t\t// 12 years in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\t\tfor ( let year = viewYear - 1; year < viewYear + 11; year++ ) {\n\t\t\tlet row = getRow( rows, year - viewYear );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderYear( year )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (years, i) => (\n\t\t\t{ years }\n\t\t));\n\t}\n\n\trenderYear( year ) {\n\t\tconst selectedYear = this.getSelectedYear();\n\t\tlet className = 'rdtYear';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledYear( year ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedYear;\n\t\t}\n\n\t\tif ( selectedYear === year ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: year, className, 'data-value': year, onClick };\n\n\t\treturn this.props.renderYear(\n\t\t\tprops,\n\t\t\tyear,\n\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t);\n\t}\n\n\tgetViewYear() {\n\t\treturn parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\t}\n\n\tgetSelectedYear() {\n\t\treturn this.props.selectedDate && this.props.selectedDate.year();\n\t}\n\n\tdisabledYearsCache = {};\n\tisDisabledYear( year ) {\n\t\tlet cache = this.disabledYearsCache;\n\t\tif ( cache[year] !== undefined ) {\n\t\t\treturn cache[year];\n\t\t}\n\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the year is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({year});\n\t\tlet day = date.endOf( 'year' ).dayOfYear() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.dayOfYear(day) ) ) {\n\t\t\t\tcache[year] = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tcache[year] = true;\n\t\treturn true;\n\t}\n\n\t_updateSelectedYear = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 3 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 7 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n","import React, { useCallback, useEffect, useState } from 'react';\nimport moment from 'moment-timezone';\n\nconst timeConstraints = {\n\thours: {\n\t\tmin: 0,\n\t\tmax: 23,\n\t\tstep: 1\n\t},\n\tminutes: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tseconds: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tmilliseconds: {\n\t\tmin: 0,\n\t\tmax: 999,\n\t\tstep: 1\n\t}\n};\n\nfunction createConstraints( overrideTimeConstraints ) {\n\tlet constraints = {};\n\n\tObject.keys( timeConstraints ).forEach( type => {\n\t\tconstraints[ type ] = { ...timeConstraints[type], ...(overrideTimeConstraints[type] || {}) };\n\t});\n\n\treturn constraints;\n}\n\nexport const IntegerInput = ({value, onChange, min, max}) => {\n\tconst [stateValue, setStateValue] = useState(value);\n\tconst invalid = parseInt(stateValue, 10) !== parseInt(value, 10);\n\n\tconst parsedValue = parseInt(value, 10);\n\tuseEffect(() => {\n\t\tsetStateValue(`${parsedValue}`);\n\t}, [parsedValue]);\n\n\tconst onChangeCallback = useCallback((e) => {\n\t\tsetStateValue(e.target.value);\n\t\tconst parsedValue = parseInt(e.target.value, 10);\n\t\tif (parsedValue || parsedValue === 0) {\n\t\t\tif (parsedValue >= min && parsedValue <= max) {\n\t\t\t\tonChange(parsedValue);\n\t\t\t}\n\t\t}\n\t}, [onChange, max, min, setStateValue]);\n\n\treturn (\n\t\t\n\t);\n};\n\nexport default class TimeView extends React.Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.constraints = createConstraints( props.timeConstraints );\n\n\t\t// This component buffers the time part values in the state \n\t\t// while the user is pressing down the buttons\n\t\t// and call the prop `setTime` when the buttons are released\n\t\tthis.state = this.getTimeParts( props.selectedDate || props.viewDate );\n\t}\n\n\trender() {\n\t\tlet items = [];\n\t\tconst timeParts = this.state;\n\t\tthis.getCounters().forEach( (c, i) => {\n\t\t\tif ( i && c !== 'ampm' ) {\n\t\t\t\titems.push(\n\t\t\t\t\t
:
\n\t\t\t\t);\n\t\t\t}\n\t\t\titems.push( this.renderCounter(c, timeParts[c]) );\n\t\t});\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{ this.renderHeader() }\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ this.props.showTimeZone && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t(GMT{ moment.tz(this.props.displayTimeZone || moment.tz.guess() ).format('Z') })\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{ this.props.displayTimeZone || moment.tz.guess() }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{ items }\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\tsetNumber(value, type) {\n\t\tthis.props.setTime( type, parseInt( value, 10 ) );\n\t}\n\n\trenderCounter( type, value ) {\n\t\tif ( type === 'hours' && this.isAMPM() ) {\n\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\tif ( value === 0 ) {\n\t\t\t\tvalue = 12;\n\t\t\t}\n\t\t}\n\n\t\tif ( type === 'ampm' ) {\n\t\t\tif ( this.props.timeFormat.indexOf(' A') !== -1 ) {\n\t\t\t\tvalue = this.props.viewDate.format('A');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = this.props.viewDate.format('a');\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'increase', type)}>▲\n\t\t\t\t
\n\t\t\t\t\t{ (type !== 'ampm') ? (\n\t\t\t\t\t\t this.setNumber(value, type)}\n\t\t\t\t\t\t\tmin={timeConstraints[type].min}\n\t\t\t\t\t\t\tmax={timeConstraints[type].max}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : value }\n\t\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'decrease', type)}>▼\n\t\t\t
\n\t\t);\n\t}\n\n\trenderHeader() {\n\t\tif ( !this.props.dateFormat ) return;\n\n\t\tconst date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('days') }>\n\t\t\t\t\t\t{ date.format( this.props.dateFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\tonStartClicking( e, action, type ) {\n\t\tif ( e && e.button && e.button !== 0 ) {\n\t\t\t// Only left clicks, thanks\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( type === 'ampm' ) return this.toggleDayPart();\n\n\t\tlet update = {};\n\t\tlet body = document.body;\n\t\tupdate[ type ] = this[ action ]( type );\n\t\tthis.setState( update );\n\n\t\tthis.timer = setTimeout( () => {\n\t\t\tthis.increaseTimer = setInterval( () => {\n\t\t\t\tupdate[ type ] = this[ action ]( type );\n\t\t\t\tthis.setState( update );\n\t\t\t}, 70);\n\t\t}, 500);\n\n\t\tthis.mouseUpListener = () => {\n\t\t\tclearTimeout( this.timer );\n\t\t\tclearInterval( this.increaseTimer );\n\t\t\tthis.props.setTime( type, parseInt( this.state[ type ], 10 ) );\n\t\t\tbody.removeEventListener( 'mouseup', this.mouseUpListener );\n\t\t\tbody.removeEventListener( 'touchend', this.mouseUpListener );\n\t\t};\n\n\t\tbody.addEventListener( 'mouseup', this.mouseUpListener );\n\t\tbody.addEventListener( 'touchend', this.mouseUpListener );\n\t}\n\n\ttoggleDayPart() {\n\t\tlet hours = parseInt( this.state.hours, 10 );\n\t\t\n\t\tif ( hours >= 12 ) {\n\t\t\thours -= 12;\n\t\t}\n\t\telse {\n\t\t\thours += 12;\n\t\t}\n\n\t\tthis.props.setTime( 'hours', hours );\n\t}\n\n\tincrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) + tc.step;\n\t\tif ( value > tc.max )\n\t\t\tvalue = tc.min + ( value - ( tc.max + 1 ) );\n\t\treturn pad( type, value );\n\t}\n\n\tdecrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) - tc.step;\n\t\tif ( value < tc.min )\n\t\t\tvalue = tc.max + 1 - ( tc.min - value );\n\t\treturn pad( type, value );\n\t}\n\n\tgetCounters() {\n\t\tlet counters = [];\n\t\tlet format = this.props.timeFormat;\n\t\t\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t\tif ( format.indexOf('S') !== -1 ) {\n\t\t\t\t\t\tcounters.push('milliseconds');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.isAMPM() ) {\n\t\t\tcounters.push('ampm');\n\t\t}\n\n\t\treturn counters;\n\t}\n\n\tisAMPM() {\n\t\treturn this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1;\n\t}\n\n\tgetTimeParts( date ) {\n\t\tconst hours = date.hours();\n\n\t\treturn {\n\t\t\thours: pad( 'hours', hours ),\n\t\t\tminutes: pad( 'minutes', date.minutes() ),\n\t\t\tseconds: pad( 'seconds', date.seconds() ),\n\t\t\tmilliseconds: pad('milliseconds', date.milliseconds() ),\n\t\t\tampm: hours < 12 ? 'am' : 'pm'\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.selectedDate ) {\n\t\t\tif ( this.props.selectedDate !== prevProps.selectedDate ) {\n\t\t\t\tthis.setState( this.getTimeParts( this.props.selectedDate ) );\n\t\t\t}\n\t\t}\n\t\telse if ( prevProps.viewDate !== this.props.viewDate ) {\n\t\t\tthis.setState( this.getTimeParts( this.props.viewDate ) );\n\t\t}\n\t}\n}\n\nfunction pad( type, value ) {\n\tconst padValues = {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t};\n\n\tlet str = value + '';\n\twhile ( str.length < padValues[ type ] )\n\t\tstr = '0' + str;\n\treturn str;\n}\n","import {createElement,Component}from'react';import {findDOMNode}from'react-dom';function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n // Also cover shadowRoot node by checking current.host\n\n\n while (current.parentNode || current.host) {\n // Only check normal node without shadowRoot\n if (current.parentNode && isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode || current.host;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};function autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();var passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class = /*#__PURE__*/function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n }\n /**\n * Remove all document's event listeners for this component\n */\n ;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n }\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n ;\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _this$props = this.props;\n _this$props.excludeScrollbar;\n var props = _objectWithoutPropertiesLoose(_this$props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}export default onClickOutsideHOC;export{IGNORE_CLASS_NAME};","import PropTypes from 'prop-types';\nimport moment from 'moment';\nimport React from 'react';\nimport DaysView from './views/DaysView';\nimport MonthsView from './views/MonthsView';\nimport YearsView from './views/YearsView';\nimport TimeView from './views/TimeView';\nimport onClickOutside from 'react-onclickoutside';\n\nconst viewModes = {\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n};\n\nconst TYPES = PropTypes;\nconst nofn = function () {};\nconst datetype = TYPES.oneOfType([ TYPES.instanceOf(moment), TYPES.instanceOf(Date), TYPES.string ]);\n\nexport default class Datetime extends React.Component {\n\tstatic propTypes = {\n\t\tvalue: datetype,\n\t\tinitialValue: datetype,\n\t\tinitialViewDate: datetype,\n\t\tinitialViewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tonOpen: TYPES.func,\n\t\tonClose: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonNavigate: TYPES.func,\n\t\tonBeforeNavigate: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tupdateOnView: TYPES.string,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\tdisplayTimeFirst: TYPES.bool,\n\t\tshowTimeZone: TYPES.bool,\n\t\tdateFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\ttimeFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool,\n\t\trenderView: TYPES.func,\n\t\trenderInput: TYPES.func,\n\t\trenderDay: TYPES.func,\n\t\trenderMonth: TYPES.func,\n\t\trenderYear: TYPES.func,\n\t}\n\n\tstatic defaultProps = {\n\t\tonOpen: nofn,\n\t\tonClose: nofn,\n\t\tonCalendarOpen: nofn,\n\t\tonCalendarClose: nofn,\n\t\tonChange: nofn,\n\t\tonNavigate: nofn,\n\t\tonBeforeNavigate: function(next) { return next; }, \n\t\tonNavigateBack: nofn,\n\t\tonNavigateForward: nofn,\n\t\tdateFormat: true,\n\t\ttimeFormat: true,\n\t\tutc: false,\n\t\tclassName: '',\n\t\tinput: true,\n\t\tinputProps: {},\n\t\ttimeConstraints: {},\n\t\tisValidDate: function() { return true; },\n\t\tstrictParsing: true,\n\t\tcloseOnSelect: false,\n\t\tcloseOnTab: true,\n\t\tcloseOnClickOutside: true,\n\t\trenderView: ( _, renderFunc ) => renderFunc(),\n\t}\n\n\t// Make moment accessible through the Datetime class\n\tstatic moment = moment;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = this.getInitialState();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.renderInput() }\n\t\t\t\t
\n\t\t\t\t\t{ this.renderView() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif ( !this.props.input ) return;\n\n\t\tconst finalInputProps = {\n\t\t\ttype: 'text',\n\t\t\tclassName: 'form-control',\n\t\t\tvalue: this.getInputValue(),\n\t\t\t...this.props.inputProps,\n\t\t\tonFocus: this._onInputFocus,\n\t\t\tonChange: this._onInputChange,\n\t\t\tonKeyDown: this._onInputKeyDown,\n\t\t\tonClick: this._onInputClick\n\t\t};\n\n\t\tif ( this.props.renderInput ) { \n\t\t\treturn (\n\t\t\t\t
\n\t\t\t\t\t{ this.props.renderInput( finalInputProps, this._openCalendar, this._closeCalendar ) }\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n\n\trenderView() {\n\t\treturn this.props.renderView( this.state.currentView, this._renderCalendar );\n\t}\n\n\t_renderCalendar = () => {\n\t\tconst props = this.props;\n\t\tconst state = this.state;\n\n\t\tlet viewProps = {\n\t\t\tviewDate: state.viewDate.clone(),\n\t\t\tselectedDate: this.getSelectedDate(),\n\t\t\tisValidDate: props.isValidDate,\n\t\t\tupdateDate: this._updateDate,\n\t\t\tnavigate: this._viewNavigate,\n\t\t\tmoment: moment,\n\t\t\tshowView: this._showView,\n\t\t\tdisplayTimeZone: props.displayTimeZone,\n\t\t\tshowTimeZone: props.showTimeZone,\n\t\t};\n\n\t\t// Probably updateOn, updateSelectedDate and setDate can be merged in the same method\n\t\t// that would update viewDate or selectedDate depending on the view and the dateFormat\n\t\tswitch ( state.currentView ) {\n\t\t\tcase viewModes.YEARS:\n\t\t\t\t// Used viewProps\n\t\t\t\t// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderYear = props.renderYear;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.MONTHS:\n\t\t\t\t// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderMonth = props.renderMonth;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.DAYS:\n\t\t\t\t// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat \n\t\t\t\tviewProps.renderDay = props.renderDay;\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t// { viewDate, selectedDate, timeFormat, dateFormat, timeConstraints, setTime, showView }\n\t\t\t\tviewProps.dateFormat = this.getFormat('date');\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\tviewProps.timeConstraints = props.timeConstraints;\n\t\t\t\tviewProps.setTime = this._setTime;\n\t\t\t\treturn ;\n\t\t}\n\t}\n\n\tgetInitialState() {\n\t\tlet props = this.props;\n\t\tlet inputFormat = this.getFormat('datetime');\n\t\tlet selectedDate = this.parseDate( props.value || props.initialValue, inputFormat );\n\n\t\tthis.checkTZ();\n\n\t\treturn {\n\t\t\topen: !props.input,\n\t\t\tcurrentView: props.initialViewMode || this.getInitialView(),\n\t\t\tviewDate: this.getInitialViewDate( selectedDate ),\n\t\t\tselectedDate: selectedDate && selectedDate.isValid() ? selectedDate : undefined,\n\t\t\tinputValue: this.getInitialInputValue( selectedDate )\n\t\t};\n\t}\n\t\n\tgetInitialViewDate( selectedDate ) {\n\t\tconst propDate = this.props.initialViewDate;\n\t\tlet viewDate;\n\t\tif ( propDate ) {\n\t\t\tviewDate = this.parseDate( propDate, this.getFormat('datetime') );\n\t\t\tif ( viewDate && viewDate.isValid() ) {\n\t\t\t\treturn viewDate;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog('The initialViewDated given \"' + propDate + '\" is not valid. Using current date instead.');\n\t\t\t}\n\t\t}\n\t\telse if ( selectedDate && selectedDate.isValid() ) {\n\t\t\treturn selectedDate.clone();\n\t\t}\n\t\treturn this.getInitialDate();\n\t}\n\n\tgetInitialDate() {\n\t\tlet m = this.localMoment();\n\t\tm.hour(0).minute(0).second(0).millisecond(0);\n\t\treturn m;\n\t}\n\n\tgetInitialView() {\n\t\tconst dateFormat = this.getFormat( 'date' );\n\t\treturn dateFormat ? this.getUpdateOn( dateFormat ) : viewModes.TIME;\n\t}\n\n\tparseDate(date, dateFormat) {\n\t\tlet parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, dateFormat);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t}\n\n\tgetClassName() {\n\t\tlet cn = 'rdt';\n\t\tlet props = this.props;\n\t\tlet propCn = props.className;\n\n\t\tif ( Array.isArray( propCn ) ) {\n\t\t\tcn += ' ' + propCn.join(' ');\n\t\t}\n\t\telse if ( propCn ) {\n\t\t\tcn += ' ' + propCn;\n\t\t}\n\n\t\tif ( !props.input ) {\n\t\t\tcn += ' rdtStatic';\n\t\t}\n\t\tif ( this.isOpen() ) {\n\t\t\tcn += ' rdtOpen';\n\t\t}\n\n\t\treturn cn;\n\t}\n\t\n\tisOpen() {\n\t\treturn !this.props.input || (this.props.open === undefined ? this.state.open : this.props.open);\n\t}\n\n\tgetUpdateOn( dateFormat ) {\n\t\tif ( this.props.updateOnView ) {\n\t\t\treturn this.props.updateOnView;\n\t\t}\n\n\t\tif ( dateFormat.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t}\n\n\tgetLocaleData() {\n\t\tlet p = this.props;\n\t\treturn this.localMoment( p.value || p.defaultValue || new Date() ).localeData();\n\t}\n\n\tgetDateFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.dateFormat;\n\t\tif ( format === true ) return locale.longDateFormat('L');\n\t\tif ( format ) return format;\n\t\treturn '';\n\t}\n\n\tgetTimeFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.timeFormat;\n\t\tif ( format === true ) {\n\t\t\treturn locale.longDateFormat('LT');\n\t\t}\n\t\treturn format || '';\n\t}\n\n\tgetFormat( type ) {\n\t\tif ( type === 'date' ) {\n\t\t\treturn this.getDateFormat();\n\t\t}\n\t\telse if ( type === 'time' ) {\n\t\t\treturn this.getTimeFormat();\n\t\t}\n\t\t\n\t\tlet dateFormat = this.getDateFormat();\n\t\tlet timeFormat = this.getTimeFormat();\n\t\tconst combinedDateTimeFormat = this.props.showTimeFirst ? `${timeFormat} ${dateFormat}` : `${dateFormat} ${timeFormat}`;\n\t\treturn dateFormat && timeFormat ? combinedDateTimeFormat : (dateFormat || timeFormat );\n\t}\n\n\t_showView = ( view, date ) => {\n\t\tconst d = ( date || this.state.viewDate ).clone();\n\t\tconst nextView = this.props.onBeforeNavigate( view, this.state.currentView, d );\n\n\t\tif ( nextView && this.state.currentView !== nextView ) {\n\t\t\tthis.props.onNavigate( nextView );\n\t\t\tthis.setState({ currentView: nextView });\n\t\t}\n\t}\n\n\tupdateTime( op, amount, type, toSelected ) {\n\t\tlet update = {};\n\t\tconst date = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t}\n\n\tviewToMethod = {days: 'date', months: 'month', years: 'year'};\n\tnextView = { days: 'time', months: 'days', years: 'months'};\n\t_updateDate = e => {\n\t\tlet state = this.state;\n\t\tlet currentView = state.currentView;\n\t\tlet updateOnView = this.getUpdateOn( this.getFormat('date') );\n\t\tlet viewDate = this.state.viewDate.clone();\n\n\t\t// Set the value into day/month/year\n\t\tviewDate[ this.viewToMethod[currentView] ](\n\t\t\tparseInt( e.target.getAttribute('data-value'), 10 )\n\t\t);\n\n\t\t// Need to set month and year will for days view (prev/next month)\n\t\tif ( currentView === 'days' ) {\n\t\t\tviewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );\n\t\t\tviewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );\n\t\t}\n\n\t\tlet update = {viewDate: viewDate};\n\t\tif ( currentView === updateOnView ) {\n\t\t\tupdate.selectedDate = viewDate.clone();\n\t\t\tupdate.inputValue = viewDate.format( this.getFormat('datetime') );\n\n\t\t\tif ( this.props.open === undefined && this.props.input && this.props.closeOnSelect ) {\n\t\t\t\tthis._closeCalendar();\n\t\t\t}\n\n\t\t\tthis.props.onChange( viewDate.clone() );\n\t\t}\n\t\telse {\n\t\t\tthis._showView( this.nextView[ currentView ], viewDate );\n\t\t}\n\n\t\tthis.setState( update );\n\t}\n\n\t_viewNavigate = ( modifier, unit ) => {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\t\n\t\t// Subtracting is just adding negative time\n\t\tviewDate.add( modifier, unit );\n\n\t\tif ( modifier > 0 ) {\n\t\t\tthis.props.onNavigateForward( modifier, unit );\n\t\t}\n\t\telse {\n\t\t\tthis.props.onNavigateBack( -(modifier), unit );\n\t\t}\n\n\t\tthis.setState({viewDate});\n\t}\n\t\n\t_setTime = ( type, value ) => {\n\t\tlet date = (this.getSelectedDate() || this.state.viewDate).clone();\n\t\t\n\t\tdate[ type ]( value );\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone(),\n\t\t\t\tinputValue: date.format( this.getFormat('datetime') )\n\t\t\t});\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t}\n\n\t_openCalendar = () => {\n\t\tif ( this.isOpen() ) return;\n\t\tthis.setState({open: true}, this.props.onOpen );\n\t}\n\n\t_closeCalendar = () => {\n\t\tif ( !this.isOpen() ) return;\n\n\t\tthis.setState({open: false}, () => {\n\t\t\t this.props.onClose( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t}\n\n\t_handleClickOutside = () => {\n\t\tlet props = this.props;\n\n\t\tif ( props.input && this.state.open && props.open === undefined && props.closeOnClickOutside ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\tlocalMoment( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tlet m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t}\n\n\tcheckTZ() {\n\t\tconst { displayTimeZone } = this.props;\n\t\tif ( displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tlog('displayTimeZone prop with value \"' + displayTimeZone + '\" is used but moment.js timezone is not loaded.', 'error');\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( prevProps === this.props ) return;\n\n\t\tlet needsUpdate = false;\n\t\tlet thisProps = this.props;\n\n\t\t['locale', 'utc', 'displayZone', 'dateFormat', 'timeFormat'].forEach( function(p) {\n\t\t\tprevProps[p] !== thisProps[p] && (needsUpdate = true);\n\t\t});\n\n\t\tif ( needsUpdate ) {\n\t\t\tthis.regenerateDates();\n\t\t}\n\n\t\tif ( thisProps.value && thisProps.value !== prevProps.value ) {\n\t\t\tthis.setViewDate( thisProps.value );\n\t\t}\n\n\t\tthis.checkTZ();\n\t}\n\n\tregenerateDates() {\n\t\tconst props = this.props;\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\tlet selectedDate = this.state.selectedDate && this.state.selectedDate.clone();\n\n\t\tif ( props.locale ) {\n\t\t\tviewDate.locale( props.locale );\n\t\t\tselectedDate &&\tselectedDate.locale( props.locale );\n\t\t}\n\t\tif ( props.utc ) {\n\t\t\tviewDate.utc();\n\t\t\tselectedDate &&\tselectedDate.utc();\n\t\t}\n\t\telse if ( props.displayTimeZone ) {\n\t\t\tviewDate.tz( props.displayTimeZone );\n\t\t\tselectedDate &&\tselectedDate.tz( props.displayTimeZone );\n\t\t}\n\t\telse {\n\t\t\tviewDate.locale();\n\t\t\tselectedDate &&\tselectedDate.locale();\n\t\t}\n\n\t\tlet update = { viewDate: viewDate, selectedDate: selectedDate};\n\t\tif ( selectedDate && selectedDate.isValid() ) {\n\t\t\tupdate.inputValue = selectedDate.format( this.getFormat('datetime') );\n\t\t}\n\t\tthis.setState( update );\n\t}\n\n\tgetSelectedDate() {\n\t\tif ( this.props.value === undefined ) return this.state.selectedDate;\n\t\tlet selectedDate = this.parseDate( this.props.value, this.getFormat('datetime') );\n\t\treturn selectedDate && selectedDate.isValid() ? selectedDate : false;\n\t}\n\n\tgetInitialInputValue( selectedDate ) {\n\t\tconst props = this.props;\n\t\tif ( props.inputProps.value )\n\t\t\treturn props.inputProps.value;\n\t\t\n\t\tif ( selectedDate && selectedDate.isValid() )\n\t\t\treturn selectedDate.format( this.getFormat('datetime') );\n\t\t\n\t\tif ( props.value && typeof props.value === 'string' )\n\t\t\treturn props.value;\n\t\t\n\t\tif ( props.initialValue && typeof props.initialValue === 'string' )\n\t\t\treturn props.initialValue;\n\t\t\n\t\treturn '';\n\t}\n\n\tgetInputValue() {\n\t\treturn this.state.inputValue;\n\t}\n\n\t/**\n\t * Set the date that is currently shown in the calendar.\n\t * This is independent from the selected date and it's the one used to navigate through months or days in the calendar.\n\t * @param dateType date\n\t * @public\n\t */\n\tsetViewDate( date ) {\n\t\tlet logError = function() {\n\t\t\treturn log( 'Invalid date passed to the `setViewDate` method: ' + date );\n\t\t};\n\n\t\tif ( !date ) return logError();\n\t\t\n\t\tlet viewDate;\n\t\tif ( typeof date === 'string' ) {\n\t\t\tviewDate = this.localMoment(date, this.getFormat('datetime') );\n\t\t}\n\t\telse {\n\t\t\tviewDate = this.localMoment( date );\n\t\t}\n\n\t\tif ( !viewDate || !viewDate.isValid() ) return logError();\n\t\tlet selectedDate = this.getSelectedDate();\n\t\tthis.setState({\n\t\t\tviewDate: viewDate,\n\t\t\tinputValue: selectedDate ? selectedDate.format( this.getFormat('datetime') ) : this.state.inputValue,\n\t\t});\n\t}\n\n\t/**\n\t * Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.\n\t * @param TYPES.string mode \n\t */\n\tnavigate( mode ) {\n\t\tthis._showView( mode );\n\t}\n\n\t_onInputFocus = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onFocus, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\t_onInputChange = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onChange, e ) ) return;\n\n\t\tconst value = e.target ? e.target.value : e;\n\t\tconst localMoment = this.localMoment( value, this.getFormat('datetime') );\n\t\tlet update = { inputValue: value };\n\n\t\tif ( localMoment.isValid() ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t}\n\t\telse {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\tthis.setState( update, () => {\n\t\t\tthis.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t}\n\n\t_onInputKeyDown = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onKeyDown, e ) ) return;\n\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\t_onInputClick = e => {\n\t\t// Focus event should open the calendar, but there is some case where\n\t\t// the input is already focused and the picker is closed, so clicking the input\n\t\t// should open it again see https://github.com/arqex/react-datetime/issues/717\n\t\tif ( !this.callHandler( this.props.inputProps.onClick, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\tcallHandler( method, e ) {\n\t\tif ( !method ) return true;\n\t\treturn method(e) !== false;\n\t}\n}\n\nfunction log( message, method ) {\n\tlet con = typeof window !== 'undefined' && window.console;\n\tif ( !con ) return;\n\n\tif ( !method ) {\n\t\tmethod = 'warn';\n\t}\n\tcon[ method ]( '***react-datetime:' + message );\n}\n\nclass ClickOutBase extends React.Component {\n\tcontainer = React.createRef();\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t{ this.props.children }\n\t\t\t
\n\t\t);\n\t}\n\thandleClickOutside(e) {\n\t\tthis.props.onClickOut( e );\n\t}\n\n\tsetClickOutsideRef() {\n\t\treturn this.container.current;\n\t}\n}\n\nconst ClickableWrapper = onClickOutside( ClickOutBase );\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Datetime/webpack/universalModuleDefinition","webpack://Datetime/webpack/bootstrap","webpack://Datetime/external \"react\"","webpack://Datetime/external \"moment\"","webpack://Datetime/external \"moment-timezone\"","webpack://Datetime/external \"react-dom\"","webpack://Datetime/./node_modules/prop-types/index.js","webpack://Datetime/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://Datetime/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://Datetime/./src/parts/ViewNavigation.js","webpack://Datetime/./src/views/DaysView.js","webpack://Datetime/./src/views/MonthsView.js","webpack://Datetime/./src/views/YearsView.js","webpack://Datetime/./src/views/TimeView.js","webpack://Datetime/./node_modules/react-onclickoutside/dist/react-onclickoutside.es.js","webpack://Datetime/./src/DateTime.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","ViewNavigation","onClickPrev","onClickSwitch","onClickNext","switchContent","switchColSpan","switchProps","className","onClick","colSpan","DaysView","e","updateDate","this","renderNavigation","renderDayHeaders","renderDays","renderFooter","date","viewDate","locale","localeData","navigate","showView","months","year","month","dayItems","first","firstDayOfWeek","dow","_weekdaysMin","forEach","day","getDaysOfWeek","map","index","startOfMonth","clone","startOf","endOfMonth","endOf","rows","startDate","subtract","daysInMonth","endDate","add","isBefore","getRow","push","renderDay","selectedDate","dayProps","format","isAfter","isSame","moment","isValidDate","_setDate","timeFormat","React","Component","Math","floor","MonthsView","event","renderMonths","renderMonth","isDisabledMonth","_updateSelectedMonth","getMonthText","set","str","localMoment","monthStr","monthsShort","substring","charAt","toUpperCase","slice","YearsView","renderYears","viewYear","getViewYear","renderYear","years","selectedYear","getSelectedYear","isDisabledYear","_updateSelectedYear","parseInt","cache","disabledYearsCache","undefined","dayOfYear","timeConstraints","hours","min","max","step","minutes","seconds","milliseconds","IntegerInput","onChange","useState","stateValue","setStateValue","invalid","parsedValue","useEffect","onChangeCallback","useCallback","target","TimeView","overrideTimeConstraints","constraints","keys","type","state","getTimeParts","items","timeParts","getCounters","renderCounter","renderHeader","showTimeZone","tz","displayTimeZone","guess","setTime","isAMPM","indexOf","onMouseDown","onStartClicking","setNumber","dateFormat","action","button","toggleDayPart","update","body","document","setState","timer","setTimeout","increaseTimer","setInterval","mouseUpListener","clearTimeout","clearInterval","removeEventListener","addEventListener","tc","pad","counters","timeCountersFormat","toLowerCase","ampm","prevProps","padValues","length","setPrototypeOf","__proto__","self","ReferenceError","isNodeFound","current","componentNode","ignoreClass","correspondingElement","classList","contains","seed","passiveEventSupport","uid","handlersMap","enabledInstances","touchEvents","getEventHandlerOptions","instance","eventName","handlerOptions","passive","preventDefault","WrappedComponent","config","_class","_temp","displayName","_Component","subClass","superClass","onClickOutside","_this","__outsideClickHandler","__clickOutsideHandlerProp","getInstance","handleClickOutside","__getComponentNode","setClickOutsideRef","enableOnClickOutside","_uid","options","noop","testPassiveEventSupport","events","eventTypes","evt","stopPropagation","excludeScrollbar","documentElement","clientWidth","clientX","clientHeight","clientY","parentNode","host","findHighest","composed","composedPath","shift","outsideClickIgnoreClass","disableOnClickOutside","fn","getRef","ref","instanceRef","constructor","_proto","isReactComponent","componentDidMount","createElement","componentDidUpdate","componentWillUnmount","render","_this$props","source","excluded","sourceKeys","_objectWithoutPropertiesLoose","wrappedRef","defaultProps","getClass","viewModes","TYPES","nofn","datetype","Date","Datetime","viewProps","getSelectedDate","_updateDate","_viewNavigate","_showView","currentView","getFormat","_setTime","view","nextView","onBeforeNavigate","onNavigate","days","updateOnView","getUpdateOn","viewToMethod","getAttribute","inputValue","open","input","closeOnSelect","_closeCalendar","modifier","unit","onNavigateForward","onNavigateBack","isOpen","onOpen","onClose","closeOnClickOutside","callHandler","inputProps","onFocus","_openCalendar","isValid","onKeyDown","which","closeOnTab","getInitialState","ClickableWrapper","getClassName","onClickOut","_handleClickOutside","renderInput","renderView","finalInputProps","getInputValue","_onInputFocus","_onInputChange","_onInputKeyDown","_onInputClick","_renderCalendar","inputFormat","parseDate","initialValue","checkTZ","initialViewMode","getInitialView","getInitialViewDate","getInitialInputValue","propDate","initialViewDate","log","getInitialDate","hour","minute","second","millisecond","parsedDate","cn","propCn","Array","isArray","join","match","defaultValue","getLocaleData","longDateFormat","getDateFormat","getTimeFormat","combinedDateTimeFormat","showTimeFirst","op","amount","toSelected","utc","strictParsing","tzWarning","needsUpdate","thisProps","regenerateDates","setViewDate","logError","method","message","con","console","displayTimeFirst","onCalendarOpen","onCalendarClose","next","_","renderFunc","createRef","container","children"],"mappings":"CAAA,SAA2CA,EAAMC,GAE1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,mBAAoBA,QAAQ,cAEzE,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,QAAS,SAAU,kBAAmB,aAAcJ,GAElC,iBAAZC,QACdA,QAAkB,SAAID,EAAQG,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,mBAAoBA,QAAQ,cAGvGJ,EAAe,SAAIC,EAAQD,EAAY,MAAGA,EAAa,OAAGA,EAAK,mBAAoBA,EAAK,cAZ1F,CAaGO,QAAQ,SAASC,EAAgCC,EAAgCC,EAAgCC,GACpH,O,YCbE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUZ,QAGnC,IAAIC,EAASS,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHd,QAAS,IAUV,OANAe,EAAQH,GAAUI,KAAKf,EAAOD,QAASC,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UAAU3L,Y,GAfG3G,IAAMC,e","file":"react-datetime.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\t//React datetime\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"moment\"), require(\"moment-timezone\"), require(\"react-dom\"));\n\t//React datetime\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"moment\", \"moment-timezone\", \"react-dom\"], factory);\n\t//React datetime\n\telse if(typeof exports === 'object')\n\t\texports[\"Datetime\"] = factory(require(\"react\"), require(\"moment\"), require(\"moment-timezone\"), require(\"react-dom\"));\n\t//React datetime\n\telse\n\t\troot[\"Datetime\"] = factory(root[\"react\"], root[\"moment\"], root[\"moment-timezone\"], root[\"react-dom\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","import React from 'react';\n\nexport default function ViewNavigation( { onClickPrev, onClickSwitch, onClickNext, switchContent, switchColSpan, switchProps } ) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{ switchContent }\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class DaysView extends React.Component {\n\tstatic defaultProps = {\n\t\tisValidDate: () => true,\n\t\trenderDay: ( props, date ) => { date.date() },\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\t{ this.renderDayHeaders() }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderDays() }\n\t\t\t\t\t\n\t\t\t\t\t{ this.renderFooter() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst date = this.props.viewDate;\n\t\tconst locale = date.localeData();\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'months' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'months' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'months' ) }\n\t\t\t\tswitchContent={ locale.months( date ) + ' ' + date.year() }\n\t\t\t\tswitchColSpan={5}\n\t\t\t\tswitchProps={ { 'data-value': this.props.viewDate.month() } }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderDayHeaders() {\n\t\tconst locale = this.props.viewDate.localeData();\n\t\tlet dayItems = getDaysOfWeek( locale ).map( (day, index) => (\n\t\t\t{ day }\n\t\t));\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ dayItems }\n\t\t\t\n\t\t);\n\t}\n\n\trenderDays() {\n\t\tconst date = this.props.viewDate;\n\t\tconst startOfMonth = date.clone().startOf('month');\n\t\tconst endOfMonth = date.clone().endOf('month');\n\n\t\t// We need 42 days in 6 rows\n\t\t// starting in the last week of the previous month\n\t\tlet rows = [[], [], [], [], [], []];\n\n\t\tlet startDate = date.clone().subtract( 1, 'months');\n\t\tstartDate.date( startDate.daysInMonth() ).startOf('week');\n\n\t\tlet endDate = startDate.clone().add( 42, 'd' );\n\t\tlet i = 0;\n\n\t\twhile ( startDate.isBefore( endDate ) ) {\n\t\t\tlet row = getRow( rows, i++ );\n\t\t\trow.push( this.renderDay( startDate, startOfMonth, endOfMonth ) );\n\t\t\tstartDate.add( 1, 'd' );\n\t\t}\n\n\t\treturn rows.map( (r, i) => (\n\t\t\t{ r }\n\t\t));\n\t}\n\n\trenderDay( date, startOfMonth, endOfMonth ) {\n\t\tlet selectedDate = this.props.selectedDate;\n\n\t\tlet dayProps = {\n\t\t\tkey: date.format('M_D'),\n\t\t\t'data-value': date.date(),\n\t\t\t'data-month': date.month(),\n\t\t\t'data-year': date.year()\n\t\t};\n\n\t\tlet className = 'rdtDay';\n\t\tif ( date.isBefore( startOfMonth ) ) {\n\t\t\tclassName += ' rdtOld';\n\t\t}\n\t\telse if ( date.isAfter( endOfMonth ) ) {\n\t\t\tclassName += ' rdtNew';\n\t\t}\n\t\tif ( selectedDate && date.isSame( selectedDate, 'day' ) ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\t\tif ( date.isSame( this.props.moment(), 'day' ) ) {\n\t\t\tclassName += ' rdtToday';\n\t\t}\n\n\t\tif ( this.props.isValidDate(date) ) {\n\t\t\tdayProps.onClick = this._setDate;\n\t\t}\n\t\telse {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\n\t\tdayProps.className = className;\n\n\t\treturn this.props.renderDay(\n\t\t\tdayProps, date.clone(), selectedDate && selectedDate.clone()\n\t\t);\n\t}\n\n\trenderFooter() {\n\t\tif ( !this.props.timeFormat ) return;\n\n\t\tconst date = this.props.viewDate;\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('time') }\n\t\t\t\t\t\tcolSpan={7}\n\t\t\t\t\t\tclassName=\"rdtTimeToggle\">\n\t\t\t\t\t\t{ date.format( this.props.timeFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t_setDate = e => {\n\t\tthis.props.updateDate( e );\n\t}\n}\n\nfunction getRow( rows, day ) {\n\treturn rows[ Math.floor( day / 7 ) ];\n}\n\n/**\n * Get a list of the days of the week\n * depending on the current locale\n * @return {array} A list with the shortname of the days\n */\nfunction getDaysOfWeek( locale ) {\n\tconst first = locale.firstDayOfWeek();\n\tlet dow = [];\n\tlet i = 0;\n\n\tlocale._weekdaysMin.forEach(function (day) {\n\t\tdow[(7 + (i++) - first) % 7] = day;\n\t});\n\n\treturn dow;\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class MonthsView extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderMonths() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tlet year = this.props.viewDate.year();\n\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'years' ) }\n\t\t\t\tswitchContent={ year }\n\t\t\t\tswitchColSpan=\"2\"\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderMonths() {\n\t\t// 12 months in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\n\t\tfor ( let month = 0; month < 12; month++ ) {\n\t\t\tlet row = getRow( rows, month );\n\n\t\t\trow.push( this.renderMonth( month ) );\n\t\t}\n\n\t\treturn rows.map( (months, i) => (\n\t\t\t{ months }\n\t\t));\n\t}\n\n\trenderMonth( month ) {\n\t\tconst selectedDate = this.props.selectedDate;\n\t\tlet className = 'rdtMonth';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledMonth( month ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedMonth;\n\t\t}\n\n\t\tif ( selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: month, className, 'data-value': month, onClick };\n\n\t\tif ( this.props.renderMonth ) {\n\t\t\treturn this.props.renderMonth(\n\t\t\t\tprops,\n\t\t\t\tmonth,\n\t\t\t\tthis.props.viewDate.year(),\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.getMonthText( month ) }\n\t\t\t\n\t\t);\n\t}\n\t\n\tisDisabledMonth( month ) {\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the month is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({month});\n\t\tlet day = date.endOf( 'month' ).date() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.date(day) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgetMonthText( month ) {\n\t\tconst localMoment = this.props.viewDate;\n\t\tconst monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\treturn capitalize( monthStr.substring( 0, 3 ) );\n\t}\n\n\t_updateSelectedMonth = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 4 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 8 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n\nfunction capitalize( str ) {\n\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class YearsView extends React.Component {\n\tstatic defaultProps = {\n\t\trenderYear: ( props, year ) => { year },\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderYears() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst viewYear = this.getViewYear();\n\t\treturn (\n\t\t\t this.props.navigate( -10, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 10, 'years' ) }\n\t\t\t\tswitchContent={ `${viewYear}-${viewYear + 9}` }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderYears() {\n\t\tconst viewYear = this.getViewYear();\n\t\t// 12 years in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\t\tfor ( let year = viewYear - 1; year < viewYear + 11; year++ ) {\n\t\t\tlet row = getRow( rows, year - viewYear );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderYear( year )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (years, i) => (\n\t\t\t{ years }\n\t\t));\n\t}\n\n\trenderYear( year ) {\n\t\tconst selectedYear = this.getSelectedYear();\n\t\tlet className = 'rdtYear';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledYear( year ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedYear;\n\t\t}\n\n\t\tif ( selectedYear === year ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: year, className, 'data-value': year, onClick };\n\n\t\treturn this.props.renderYear(\n\t\t\tprops,\n\t\t\tyear,\n\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t);\n\t}\n\n\tgetViewYear() {\n\t\treturn parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\t}\n\n\tgetSelectedYear() {\n\t\treturn this.props.selectedDate && this.props.selectedDate.year();\n\t}\n\n\tdisabledYearsCache = {};\n\tisDisabledYear( year ) {\n\t\tlet cache = this.disabledYearsCache;\n\t\tif ( cache[year] !== undefined ) {\n\t\t\treturn cache[year];\n\t\t}\n\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the year is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({year});\n\t\tlet day = date.endOf( 'year' ).dayOfYear() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.dayOfYear(day) ) ) {\n\t\t\t\tcache[year] = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tcache[year] = true;\n\t\treturn true;\n\t}\n\n\t_updateSelectedYear = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 3 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 7 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n","import React, { useCallback, useEffect, useState } from 'react';\nimport moment from 'moment-timezone';\n\nconst timeConstraints = {\n\thours: {\n\t\tmin: 0,\n\t\tmax: 23,\n\t\tstep: 1\n\t},\n\tminutes: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tseconds: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tmilliseconds: {\n\t\tmin: 0,\n\t\tmax: 999,\n\t\tstep: 1\n\t}\n};\n\nfunction createConstraints( overrideTimeConstraints ) {\n\tlet constraints = {};\n\n\tObject.keys( timeConstraints ).forEach( type => {\n\t\tconstraints[ type ] = { ...timeConstraints[type], ...(overrideTimeConstraints[type] || {}) };\n\t});\n\n\treturn constraints;\n}\n\nexport const IntegerInput = ({value, onChange, min, max}) => {\n\tconst [stateValue, setStateValue] = useState(value);\n\tconst invalid = parseInt(stateValue, 10) !== parseInt(value, 10);\n\n\tconst parsedValue = parseInt(value, 10);\n\tuseEffect(() => {\n\t\tsetStateValue(`${parsedValue}`);\n\t}, [parsedValue]);\n\n\tconst onChangeCallback = useCallback((e) => {\n\t\tsetStateValue(e.target.value);\n\t\tconst parsedValue = parseInt(e.target.value, 10);\n\t\tif (parsedValue || parsedValue === 0) {\n\t\t\tif (parsedValue >= min && parsedValue <= max) {\n\t\t\t\tonChange(parsedValue);\n\t\t\t}\n\t\t}\n\t}, [onChange, max, min, setStateValue]);\n\n\treturn (\n\t\t\n\t);\n};\n\nexport default class TimeView extends React.Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.constraints = createConstraints( props.timeConstraints );\n\n\t\t// This component buffers the time part values in the state \n\t\t// while the user is pressing down the buttons\n\t\t// and call the prop `setTime` when the buttons are released\n\t\tthis.state = this.getTimeParts( props.selectedDate || props.viewDate );\n\t}\n\n\trender() {\n\t\tlet items = [];\n\t\tconst timeParts = this.state;\n\t\tthis.getCounters().forEach( (c, i) => {\n\t\t\tif ( i && c !== 'ampm' ) {\n\t\t\t\titems.push(\n\t\t\t\t\t
:
\n\t\t\t\t);\n\t\t\t}\n\t\t\titems.push( this.renderCounter(c, timeParts[c]) );\n\t\t});\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{ this.renderHeader() }\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ this.props.showTimeZone && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t(GMT{ moment.tz(this.props.displayTimeZone || moment.tz.guess() ).format('Z') })\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{ this.props.displayTimeZone || moment.tz.guess() }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{ items }\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\tsetNumber(value, type) {\n\t\tthis.props.setTime( type, parseInt( value, 10 ) );\n\t}\n\n\trenderCounter( type, value ) {\n\t\tif ( type === 'hours' && this.isAMPM() ) {\n\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\tif ( value === 0 ) {\n\t\t\t\tvalue = 12;\n\t\t\t}\n\t\t}\n\n\t\tif ( type === 'ampm' ) {\n\t\t\tif ( this.props.timeFormat.indexOf(' A') !== -1 ) {\n\t\t\t\tvalue = this.props.viewDate.format('A');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = this.props.viewDate.format('a');\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'increase', type)}>▲\n\t\t\t\t
\n\t\t\t\t\t{ (type !== 'ampm') ? (\n\t\t\t\t\t\t this.setNumber(value, type)}\n\t\t\t\t\t\t\tmin={timeConstraints[type].min}\n\t\t\t\t\t\t\tmax={timeConstraints[type].max}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : value }\n\t\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'decrease', type)}>▼\n\t\t\t
\n\t\t);\n\t}\n\n\trenderHeader() {\n\t\tif ( !this.props.dateFormat ) return;\n\n\t\tconst date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('days') }>\n\t\t\t\t\t\t{ date.format( this.props.dateFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\tonStartClicking( e, action, type ) {\n\t\tif ( e && e.button && e.button !== 0 ) {\n\t\t\t// Only left clicks, thanks\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( type === 'ampm' ) return this.toggleDayPart();\n\n\t\tlet update = {};\n\t\tlet body = document.body;\n\t\tupdate[ type ] = this[ action ]( type );\n\t\tthis.setState( update );\n\n\t\tthis.timer = setTimeout( () => {\n\t\t\tthis.increaseTimer = setInterval( () => {\n\t\t\t\tupdate[ type ] = this[ action ]( type );\n\t\t\t\tthis.setState( update );\n\t\t\t}, 70);\n\t\t}, 500);\n\n\t\tthis.mouseUpListener = () => {\n\t\t\tclearTimeout( this.timer );\n\t\t\tclearInterval( this.increaseTimer );\n\t\t\tthis.props.setTime( type, parseInt( this.state[ type ], 10 ) );\n\t\t\tbody.removeEventListener( 'mouseup', this.mouseUpListener );\n\t\t\tbody.removeEventListener( 'touchend', this.mouseUpListener );\n\t\t};\n\n\t\tbody.addEventListener( 'mouseup', this.mouseUpListener );\n\t\tbody.addEventListener( 'touchend', this.mouseUpListener );\n\t}\n\n\ttoggleDayPart() {\n\t\tlet hours = parseInt( this.state.hours, 10 );\n\t\t\n\t\tif ( hours >= 12 ) {\n\t\t\thours -= 12;\n\t\t}\n\t\telse {\n\t\t\thours += 12;\n\t\t}\n\n\t\tthis.props.setTime( 'hours', hours );\n\t}\n\n\tincrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) + tc.step;\n\t\tif ( value > tc.max )\n\t\t\tvalue = tc.min + ( value - ( tc.max + 1 ) );\n\t\treturn pad( type, value );\n\t}\n\n\tdecrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) - tc.step;\n\t\tif ( value < tc.min )\n\t\t\tvalue = tc.max + 1 - ( tc.min - value );\n\t\treturn pad( type, value );\n\t}\n\n\tgetCounters() {\n\t\tlet counters = [];\n\t\tlet format = this.props.timeCountersFormat || this.props.timeFormat;\n\t\t\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t\tif ( format.indexOf('S') !== -1 ) {\n\t\t\t\t\t\tcounters.push('milliseconds');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.isAMPM() ) {\n\t\t\tcounters.push('ampm');\n\t\t}\n\n\t\treturn counters;\n\t}\n\n\tisAMPM() {\n\t\treturn this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1;\n\t}\n\n\tgetTimeParts( date ) {\n\t\tconst hours = date.hours();\n\n\t\treturn {\n\t\t\thours: pad( 'hours', hours ),\n\t\t\tminutes: pad( 'minutes', date.minutes() ),\n\t\t\tseconds: pad( 'seconds', date.seconds() ),\n\t\t\tmilliseconds: pad('milliseconds', date.milliseconds() ),\n\t\t\tampm: hours < 12 ? 'am' : 'pm'\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.selectedDate ) {\n\t\t\tif ( this.props.selectedDate !== prevProps.selectedDate ) {\n\t\t\t\tthis.setState( this.getTimeParts( this.props.selectedDate ) );\n\t\t\t}\n\t\t}\n\t\telse if ( prevProps.viewDate !== this.props.viewDate ) {\n\t\t\tthis.setState( this.getTimeParts( this.props.viewDate ) );\n\t\t}\n\t}\n}\n\nfunction pad( type, value ) {\n\tconst padValues = {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t};\n\n\tlet str = value + '';\n\twhile ( str.length < padValues[ type ] )\n\t\tstr = '0' + str;\n\treturn str;\n}\n","import {createElement,Component}from'react';import {findDOMNode}from'react-dom';function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n // Also cover shadowRoot node by checking current.host\n\n\n while (current.parentNode || current.host) {\n // Only check normal node without shadowRoot\n if (current.parentNode && isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode || current.host;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};function autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();var passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class = /*#__PURE__*/function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n }\n /**\n * Remove all document's event listeners for this component\n */\n ;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n }\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n ;\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _this$props = this.props;\n _this$props.excludeScrollbar;\n var props = _objectWithoutPropertiesLoose(_this$props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}export default onClickOutsideHOC;export{IGNORE_CLASS_NAME};","import PropTypes from 'prop-types';\nimport moment from 'moment';\nimport React from 'react';\nimport DaysView from './views/DaysView';\nimport MonthsView from './views/MonthsView';\nimport YearsView from './views/YearsView';\nimport TimeView from './views/TimeView';\nimport onClickOutside from 'react-onclickoutside';\n\nconst viewModes = {\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n};\n\nconst TYPES = PropTypes;\nconst nofn = function () {};\nconst datetype = TYPES.oneOfType([ TYPES.instanceOf(moment), TYPES.instanceOf(Date), TYPES.string ]);\n\nexport default class Datetime extends React.Component {\n\tstatic propTypes = {\n\t\tvalue: datetype,\n\t\tinitialValue: datetype,\n\t\tinitialViewDate: datetype,\n\t\tinitialViewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tonOpen: TYPES.func,\n\t\tonClose: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonNavigate: TYPES.func,\n\t\tonBeforeNavigate: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tupdateOnView: TYPES.string,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\tdisplayTimeFirst: TYPES.bool,\n\t\tshowTimeZone: TYPES.bool,\n\t\tdateFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\ttimeFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool,\n\t\trenderView: TYPES.func,\n\t\trenderInput: TYPES.func,\n\t\trenderDay: TYPES.func,\n\t\trenderMonth: TYPES.func,\n\t\trenderYear: TYPES.func,\n\t}\n\n\tstatic defaultProps = {\n\t\tonOpen: nofn,\n\t\tonClose: nofn,\n\t\tonCalendarOpen: nofn,\n\t\tonCalendarClose: nofn,\n\t\tonChange: nofn,\n\t\tonNavigate: nofn,\n\t\tonBeforeNavigate: function(next) { return next; }, \n\t\tonNavigateBack: nofn,\n\t\tonNavigateForward: nofn,\n\t\tdateFormat: true,\n\t\ttimeFormat: true,\n\t\tutc: false,\n\t\tclassName: '',\n\t\tinput: true,\n\t\tinputProps: {},\n\t\ttimeConstraints: {},\n\t\tisValidDate: function() { return true; },\n\t\tstrictParsing: true,\n\t\tcloseOnSelect: false,\n\t\tcloseOnTab: true,\n\t\tcloseOnClickOutside: true,\n\t\trenderView: ( _, renderFunc ) => renderFunc(),\n\t}\n\n\t// Make moment accessible through the Datetime class\n\tstatic moment = moment;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = this.getInitialState();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.renderInput() }\n\t\t\t\t
\n\t\t\t\t\t{ this.renderView() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif ( !this.props.input ) return;\n\n\t\tconst finalInputProps = {\n\t\t\ttype: 'text',\n\t\t\tclassName: 'form-control',\n\t\t\tvalue: this.getInputValue(),\n\t\t\t...this.props.inputProps,\n\t\t\tonFocus: this._onInputFocus,\n\t\t\tonChange: this._onInputChange,\n\t\t\tonKeyDown: this._onInputKeyDown,\n\t\t\tonClick: this._onInputClick\n\t\t};\n\n\t\tif ( this.props.renderInput ) { \n\t\t\treturn (\n\t\t\t\t
\n\t\t\t\t\t{ this.props.renderInput( finalInputProps, this._openCalendar, this._closeCalendar ) }\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n\n\trenderView() {\n\t\treturn this.props.renderView( this.state.currentView, this._renderCalendar );\n\t}\n\n\t_renderCalendar = () => {\n\t\tconst props = this.props;\n\t\tconst state = this.state;\n\n\t\tlet viewProps = {\n\t\t\tviewDate: state.viewDate.clone(),\n\t\t\tselectedDate: this.getSelectedDate(),\n\t\t\tisValidDate: props.isValidDate,\n\t\t\tupdateDate: this._updateDate,\n\t\t\tnavigate: this._viewNavigate,\n\t\t\tmoment: moment,\n\t\t\tshowView: this._showView,\n\t\t\tdisplayTimeZone: props.displayTimeZone,\n\t\t\tshowTimeZone: props.showTimeZone,\n\t\t\ttimeCountersFormat: props.timeCountersFormat,\n\t\t};\n\n\t\t// Probably updateOn, updateSelectedDate and setDate can be merged in the same method\n\t\t// that would update viewDate or selectedDate depending on the view and the dateFormat\n\t\tswitch ( state.currentView ) {\n\t\t\tcase viewModes.YEARS:\n\t\t\t\t// Used viewProps\n\t\t\t\t// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderYear = props.renderYear;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.MONTHS:\n\t\t\t\t// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderMonth = props.renderMonth;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.DAYS:\n\t\t\t\t// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat \n\t\t\t\tviewProps.renderDay = props.renderDay;\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t// { viewDate, selectedDate, timeFormat, dateFormat, timeConstraints, setTime, showView }\n\t\t\t\tviewProps.dateFormat = this.getFormat('date');\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\tviewProps.timeConstraints = props.timeConstraints;\n\t\t\t\tviewProps.setTime = this._setTime;\n\t\t\t\treturn ;\n\t\t}\n\t}\n\n\tgetInitialState() {\n\t\tlet props = this.props;\n\t\tlet inputFormat = this.getFormat('datetime');\n\t\tlet selectedDate = this.parseDate( props.value || props.initialValue, inputFormat );\n\n\t\tthis.checkTZ();\n\n\t\treturn {\n\t\t\topen: !props.input,\n\t\t\tcurrentView: props.initialViewMode || this.getInitialView(),\n\t\t\tviewDate: this.getInitialViewDate( selectedDate ),\n\t\t\tselectedDate: selectedDate && selectedDate.isValid() ? selectedDate : undefined,\n\t\t\tinputValue: this.getInitialInputValue( selectedDate )\n\t\t};\n\t}\n\t\n\tgetInitialViewDate( selectedDate ) {\n\t\tconst propDate = this.props.initialViewDate;\n\t\tlet viewDate;\n\t\tif ( propDate ) {\n\t\t\tviewDate = this.parseDate( propDate, this.getFormat('datetime') );\n\t\t\tif ( viewDate && viewDate.isValid() ) {\n\t\t\t\treturn viewDate;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog('The initialViewDated given \"' + propDate + '\" is not valid. Using current date instead.');\n\t\t\t}\n\t\t}\n\t\telse if ( selectedDate && selectedDate.isValid() ) {\n\t\t\treturn selectedDate.clone();\n\t\t}\n\t\treturn this.getInitialDate();\n\t}\n\n\tgetInitialDate() {\n\t\tlet m = this.localMoment();\n\t\tm.hour(0).minute(0).second(0).millisecond(0);\n\t\treturn m;\n\t}\n\n\tgetInitialView() {\n\t\tconst dateFormat = this.getFormat( 'date' );\n\t\treturn dateFormat ? this.getUpdateOn( dateFormat ) : viewModes.TIME;\n\t}\n\n\tparseDate(date, dateFormat) {\n\t\tlet parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, dateFormat);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t}\n\n\tgetClassName() {\n\t\tlet cn = 'rdt';\n\t\tlet props = this.props;\n\t\tlet propCn = props.className;\n\n\t\tif ( Array.isArray( propCn ) ) {\n\t\t\tcn += ' ' + propCn.join(' ');\n\t\t}\n\t\telse if ( propCn ) {\n\t\t\tcn += ' ' + propCn;\n\t\t}\n\n\t\tif ( !props.input ) {\n\t\t\tcn += ' rdtStatic';\n\t\t}\n\t\tif ( this.isOpen() ) {\n\t\t\tcn += ' rdtOpen';\n\t\t}\n\n\t\treturn cn;\n\t}\n\t\n\tisOpen() {\n\t\treturn !this.props.input || (this.props.open === undefined ? this.state.open : this.props.open);\n\t}\n\n\tgetUpdateOn( dateFormat ) {\n\t\tif ( this.props.updateOnView ) {\n\t\t\treturn this.props.updateOnView;\n\t\t}\n\n\t\tif ( dateFormat.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t}\n\n\tgetLocaleData() {\n\t\tlet p = this.props;\n\t\treturn this.localMoment( p.value || p.defaultValue || new Date() ).localeData();\n\t}\n\n\tgetDateFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.dateFormat;\n\t\tif ( format === true ) return locale.longDateFormat('L');\n\t\tif ( format ) return format;\n\t\treturn '';\n\t}\n\n\tgetTimeFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.timeFormat;\n\t\tif ( format === true ) {\n\t\t\treturn locale.longDateFormat('LT');\n\t\t}\n\t\treturn format || '';\n\t}\n\n\tgetFormat( type ) {\n\t\tif ( type === 'date' ) {\n\t\t\treturn this.getDateFormat();\n\t\t}\n\t\telse if ( type === 'time' ) {\n\t\t\treturn this.getTimeFormat();\n\t\t}\n\t\t\n\t\tlet dateFormat = this.getDateFormat();\n\t\tlet timeFormat = this.getTimeFormat();\n\t\tconst combinedDateTimeFormat = this.props.showTimeFirst ? `${timeFormat} ${dateFormat}` : `${dateFormat} ${timeFormat}`;\n\t\treturn dateFormat && timeFormat ? combinedDateTimeFormat : (dateFormat || timeFormat );\n\t}\n\n\t_showView = ( view, date ) => {\n\t\tconst d = ( date || this.state.viewDate ).clone();\n\t\tconst nextView = this.props.onBeforeNavigate( view, this.state.currentView, d );\n\n\t\tif ( nextView && this.state.currentView !== nextView ) {\n\t\t\tthis.props.onNavigate( nextView );\n\t\t\tthis.setState({ currentView: nextView });\n\t\t}\n\t}\n\n\tupdateTime( op, amount, type, toSelected ) {\n\t\tlet update = {};\n\t\tconst date = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t}\n\n\tviewToMethod = {days: 'date', months: 'month', years: 'year'};\n\tnextView = { days: 'time', months: 'days', years: 'months'};\n\t_updateDate = e => {\n\t\tlet state = this.state;\n\t\tlet currentView = state.currentView;\n\t\tlet updateOnView = this.getUpdateOn( this.getFormat('date') );\n\t\tlet viewDate = this.state.viewDate.clone();\n\n\t\t// Set the value into day/month/year\n\t\tviewDate[ this.viewToMethod[currentView] ](\n\t\t\tparseInt( e.target.getAttribute('data-value'), 10 )\n\t\t);\n\n\t\t// Need to set month and year will for days view (prev/next month)\n\t\tif ( currentView === 'days' ) {\n\t\t\tviewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );\n\t\t\tviewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );\n\t\t}\n\n\t\tlet update = {viewDate: viewDate};\n\t\tif ( currentView === updateOnView ) {\n\t\t\tupdate.selectedDate = viewDate.clone();\n\t\t\tupdate.inputValue = viewDate.format( this.getFormat('datetime') );\n\n\t\t\tif ( this.props.open === undefined && this.props.input && this.props.closeOnSelect ) {\n\t\t\t\tthis._closeCalendar();\n\t\t\t}\n\n\t\t\tthis.props.onChange( viewDate.clone() );\n\t\t}\n\t\telse {\n\t\t\tthis._showView( this.nextView[ currentView ], viewDate );\n\t\t}\n\n\t\tthis.setState( update );\n\t}\n\n\t_viewNavigate = ( modifier, unit ) => {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\t\n\t\t// Subtracting is just adding negative time\n\t\tviewDate.add( modifier, unit );\n\n\t\tif ( modifier > 0 ) {\n\t\t\tthis.props.onNavigateForward( modifier, unit );\n\t\t}\n\t\telse {\n\t\t\tthis.props.onNavigateBack( -(modifier), unit );\n\t\t}\n\n\t\tthis.setState({viewDate});\n\t}\n\t\n\t_setTime = ( type, value ) => {\n\t\tlet date = (this.getSelectedDate() || this.state.viewDate).clone();\n\t\t\n\t\tdate[ type ]( value );\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone(),\n\t\t\t\tinputValue: date.format( this.getFormat('datetime') )\n\t\t\t});\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t}\n\n\t_openCalendar = () => {\n\t\tif ( this.isOpen() ) return;\n\t\tthis.setState({open: true}, this.props.onOpen );\n\t}\n\n\t_closeCalendar = () => {\n\t\tif ( !this.isOpen() ) return;\n\n\t\tthis.setState({open: false}, () => {\n\t\t\t this.props.onClose( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t}\n\n\t_handleClickOutside = () => {\n\t\tlet props = this.props;\n\n\t\tif ( props.input && this.state.open && props.open === undefined && props.closeOnClickOutside ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\tlocalMoment( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tlet m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t}\n\n\tcheckTZ() {\n\t\tconst { displayTimeZone } = this.props;\n\t\tif ( displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tlog('displayTimeZone prop with value \"' + displayTimeZone + '\" is used but moment.js timezone is not loaded.', 'error');\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( prevProps === this.props ) return;\n\n\t\tlet needsUpdate = false;\n\t\tlet thisProps = this.props;\n\n\t\t['locale', 'utc', 'displayZone', 'dateFormat', 'timeFormat'].forEach( function(p) {\n\t\t\tprevProps[p] !== thisProps[p] && (needsUpdate = true);\n\t\t});\n\n\t\tif ( needsUpdate ) {\n\t\t\tthis.regenerateDates();\n\t\t}\n\n\t\tif ( thisProps.value && thisProps.value !== prevProps.value ) {\n\t\t\tthis.setViewDate( thisProps.value );\n\t\t}\n\n\t\tthis.checkTZ();\n\t}\n\n\tregenerateDates() {\n\t\tconst props = this.props;\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\tlet selectedDate = this.state.selectedDate && this.state.selectedDate.clone();\n\n\t\tif ( props.locale ) {\n\t\t\tviewDate.locale( props.locale );\n\t\t\tselectedDate &&\tselectedDate.locale( props.locale );\n\t\t}\n\t\tif ( props.utc ) {\n\t\t\tviewDate.utc();\n\t\t\tselectedDate &&\tselectedDate.utc();\n\t\t}\n\t\telse if ( props.displayTimeZone ) {\n\t\t\tviewDate.tz( props.displayTimeZone );\n\t\t\tselectedDate &&\tselectedDate.tz( props.displayTimeZone );\n\t\t}\n\t\telse {\n\t\t\tviewDate.locale();\n\t\t\tselectedDate &&\tselectedDate.locale();\n\t\t}\n\n\t\tlet update = { viewDate: viewDate, selectedDate: selectedDate};\n\t\tif ( selectedDate && selectedDate.isValid() ) {\n\t\t\tupdate.inputValue = selectedDate.format( this.getFormat('datetime') );\n\t\t}\n\t\tthis.setState( update );\n\t}\n\n\tgetSelectedDate() {\n\t\tif ( this.props.value === undefined ) return this.state.selectedDate;\n\t\tlet selectedDate = this.parseDate( this.props.value, this.getFormat('datetime') );\n\t\treturn selectedDate && selectedDate.isValid() ? selectedDate : false;\n\t}\n\n\tgetInitialInputValue( selectedDate ) {\n\t\tconst props = this.props;\n\t\tif ( props.inputProps.value )\n\t\t\treturn props.inputProps.value;\n\t\t\n\t\tif ( selectedDate && selectedDate.isValid() )\n\t\t\treturn selectedDate.format( this.getFormat('datetime') );\n\t\t\n\t\tif ( props.value && typeof props.value === 'string' )\n\t\t\treturn props.value;\n\t\t\n\t\tif ( props.initialValue && typeof props.initialValue === 'string' )\n\t\t\treturn props.initialValue;\n\t\t\n\t\treturn '';\n\t}\n\n\tgetInputValue() {\n\t\treturn this.state.inputValue;\n\t}\n\n\t/**\n\t * Set the date that is currently shown in the calendar.\n\t * This is independent from the selected date and it's the one used to navigate through months or days in the calendar.\n\t * @param dateType date\n\t * @public\n\t */\n\tsetViewDate( date ) {\n\t\tlet logError = function() {\n\t\t\treturn log( 'Invalid date passed to the `setViewDate` method: ' + date );\n\t\t};\n\n\t\tif ( !date ) return logError();\n\t\t\n\t\tlet viewDate;\n\t\tif ( typeof date === 'string' ) {\n\t\t\tviewDate = this.localMoment(date, this.getFormat('datetime') );\n\t\t}\n\t\telse {\n\t\t\tviewDate = this.localMoment( date );\n\t\t}\n\n\t\tif ( !viewDate || !viewDate.isValid() ) return logError();\n\t\tlet selectedDate = this.getSelectedDate();\n\t\tthis.setState({\n\t\t\tviewDate: viewDate,\n\t\t\tinputValue: selectedDate ? selectedDate.format( this.getFormat('datetime') ) : this.state.inputValue,\n\t\t});\n\t}\n\n\t/**\n\t * Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.\n\t * @param TYPES.string mode \n\t */\n\tnavigate( mode ) {\n\t\tthis._showView( mode );\n\t}\n\n\t_onInputFocus = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onFocus, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\t_onInputChange = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onChange, e ) ) return;\n\n\t\tconst value = e.target ? e.target.value : e;\n\t\tconst localMoment = this.localMoment( value, this.getFormat('datetime') );\n\t\tlet update = { inputValue: value };\n\n\t\tif ( localMoment.isValid() ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t}\n\t\telse {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\tthis.setState( update, () => {\n\t\t\tthis.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t}\n\n\t_onInputKeyDown = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onKeyDown, e ) ) return;\n\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\t_onInputClick = e => {\n\t\t// Focus event should open the calendar, but there is some case where\n\t\t// the input is already focused and the picker is closed, so clicking the input\n\t\t// should open it again see https://github.com/arqex/react-datetime/issues/717\n\t\tif ( !this.callHandler( this.props.inputProps.onClick, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\tcallHandler( method, e ) {\n\t\tif ( !method ) return true;\n\t\treturn method(e) !== false;\n\t}\n}\n\nfunction log( message, method ) {\n\tlet con = typeof window !== 'undefined' && window.console;\n\tif ( !con ) return;\n\n\tif ( !method ) {\n\t\tmethod = 'warn';\n\t}\n\tcon[ method ]( '***react-datetime:' + message );\n}\n\nclass ClickOutBase extends React.Component {\n\tcontainer = React.createRef();\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t{ this.props.children }\n\t\t\t
\n\t\t);\n\t}\n\thandleClickOutside(e) {\n\t\tthis.props.onClickOut( e );\n\t}\n\n\tsetClickOutsideRef() {\n\t\treturn this.container.current;\n\t}\n}\n\nconst ClickableWrapper = onClickOutside( ClickOutBase );\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 2d7095cdf..707ff2829 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-datetime", - "version": "3.1.0-unc-6", + "version": "3.1.0-unc-7", "description": "A lightweight but complete datetime picker React.js component", "homepage": "https://github.com/arqex/react-datetime", "repository": { diff --git a/react-datetime.d.ts b/react-datetime.d.ts index 8935fdcef..1852a6f24 100644 --- a/react-datetime.d.ts +++ b/react-datetime.d.ts @@ -195,6 +195,12 @@ declare module ReactDatetime { display as