react-datetime
Advanced tools
Comparing version 2.15.0 to 2.16.0
Changelog | ||
========= | ||
## 2.16.0 | ||
* The prop `disableOnClickOutside` has been renamed to `disableCloseOnClickOutside` | ||
* The calendar doesn't get closed an open when clicking in the input anymore. | ||
* Fixes errors not finding dates when customizing day rendering. | ||
* Event listeners in `inputProps` now only override default behaviour when returning `false`. | ||
* Adds the `displayTimeZone` prop. Thanks to @martingordon | ||
## 2.15.0 | ||
@@ -4,0 +11,0 @@ * New `onNavigateBack` and `onNavigateForward` hooks thanks to @DaanDD and @simeg. |
@@ -80,2 +80,7 @@ // Type definitions for react-datetime | ||
/* | ||
When specified, input time values will be displayed in the given time zone. Otherwise they will default | ||
to the user's local timezone (unless `utc` specified). | ||
*/ | ||
displayTimeZone?: string; | ||
/* | ||
Callback trigger when the date changes. The callback receives the selected `moment` object as | ||
@@ -82,0 +87,0 @@ only parameter, if the date in the input is valid. If the date in the input is not valid, the |
@@ -8,3 +8,4 @@ 'use strict'; | ||
React = require('react'), | ||
CalendarContainer = require('./src/CalendarContainer') | ||
CalendarContainer = require('./src/CalendarContainer'), | ||
onClickOutside = require('react-onclickoutside').default | ||
; | ||
@@ -34,2 +35,3 @@ | ||
utc: TYPES.bool, | ||
displayTimeZone: TYPES.string, | ||
input: TYPES.bool, | ||
@@ -182,3 +184,3 @@ // dateFormat: TYPES.string | TYPES.bool, | ||
if ( nextProps.utc !== this.props.utc ) { | ||
if ( nextProps.utc !== this.props.utc || nextProps.displayTimeZone !== this.props.displayTimeZone ) { | ||
if ( nextProps.utc ) { | ||
@@ -191,2 +193,9 @@ if ( this.state.viewDate ) | ||
} | ||
} else if ( nextProps.displayTimeZone ) { | ||
if ( this.state.viewDate ) | ||
updatedState.viewDate = this.state.viewDate.clone().tz(nextProps.displayTimeZone); | ||
if ( this.state.selectedDate ) { | ||
updatedState.selectedDate = this.state.selectedDate.clone().tz(nextProps.displayTimeZone); | ||
updatedState.inputValue = updatedState.selectedDate.tz(nextProps.displayTimeZone).format( formats.datetime ); | ||
} | ||
} else { | ||
@@ -314,3 +323,3 @@ if ( this.state.viewDate ) | ||
updateSelectedDate: function( e, close ) { | ||
var target = e.target, | ||
var target = e.currentTarget, | ||
modifier = 0, | ||
@@ -383,3 +392,3 @@ viewDate = this.state.viewDate, | ||
handleClickOutside: function() { | ||
if ( this.props.input && this.state.open && !this.props.open && !this.props.disableOnClickOutside ) { | ||
if ( this.props.input && this.state.open && this.props.open === undefined && !this.props.disableCloseOnClickOutside ) { | ||
this.setState({ open: false }, function() { | ||
@@ -393,4 +402,12 @@ this.props.onBlur( this.state.selectedDate || this.state.inputValue ); | ||
props = props || this.props; | ||
var momentFn = props.utc ? moment.utc : moment; | ||
var m = momentFn( date, format, props.strictParsing ); | ||
var m = null; | ||
if (props.utc) { | ||
m = moment.utc(date, format, props.strictParsing); | ||
} else if (props.displayTimeZone) { | ||
m = moment.tz(date, format, props.displayTimeZone); | ||
} else { | ||
m = moment(date, format, props.strictParsing); | ||
} | ||
if ( props.locale ) | ||
@@ -426,2 +443,23 @@ m.locale( props.locale ); | ||
overrideEvent: function( handler, action ) { | ||
if ( !this.overridenEvents ) { | ||
this.overridenEvents = {}; | ||
} | ||
if ( !this.overridenEvents[handler] ) { | ||
var me = this; | ||
this.overridenEvents[handler] = function( e ) { | ||
var result; | ||
if ( me.props.inputProps && me.props.inputProps[handler] ) { | ||
result = me.props.inputProps[handler]( e ); | ||
} | ||
if ( result !== false ) { | ||
action( e ); | ||
} | ||
}; | ||
} | ||
return this.overridenEvents[handler]; | ||
}, | ||
render: function() { | ||
@@ -431,4 +469,4 @@ // TODO: Make a function or clean up this code, | ||
var className = 'rdt' + (this.props.className ? | ||
( Array.isArray( this.props.className ) ? | ||
' ' + this.props.className.join( ' ' ) : ' ' + this.props.className) : ''), | ||
( Array.isArray( this.props.className ) ? | ||
' ' + this.props.className.join( ' ' ) : ' ' + this.props.className) : ''), | ||
children = []; | ||
@@ -440,6 +478,6 @@ | ||
className: 'form-control', | ||
onClick: this.openCalendar, | ||
onFocus: this.openCalendar, | ||
onChange: this.onInputChange, | ||
onKeyDown: this.onInputKey, | ||
onClick: this.overrideEvent( 'onClick', this.openCalendar ), | ||
onFocus: this.overrideEvent( 'onFocus', this.openCalendar ), | ||
onChange: this.overrideEvent( 'onChange', this.onInputChange ), | ||
onKeyDown: this.overrideEvent( 'onKeyDown', this.onInputKey ), | ||
value: this.state.inputValue, | ||
@@ -456,9 +494,9 @@ }, this.props.inputProps); | ||
if ( this.state.open ) | ||
if ( this.props.open || (this.props.open === undefined && this.state.open ) ) | ||
className += ' rdtOpen'; | ||
return React.createElement( 'div', { className: className }, children.concat( | ||
return React.createElement( ClickableWrapper, {className: className, onClickOut: this.handleClickOutside}, children.concat( | ||
React.createElement( 'div', | ||
{ key: 'dt', className: 'rdtPicker' }, | ||
React.createElement( CalendarContainer, { view: this.state.currentView, viewProps: this.getComponentProps(), onClickOutside: this.handleClickOutside }) | ||
React.createElement( CalendarContainer, { view: this.state.currentView, viewProps: this.getComponentProps() }) | ||
) | ||
@@ -469,2 +507,11 @@ )); | ||
var ClickableWrapper = onClickOutside( createClass({ | ||
render: function() { | ||
return React.createElement( 'div', { className: this.props.className }, this.props.children ); | ||
}, | ||
handleClickOutside: function( e ) { | ||
this.props.onClickOut( e ); | ||
} | ||
})); | ||
Datetime.defaultProps = { | ||
@@ -471,0 +518,0 @@ className: '', |
/* | ||
react-datetime v2.15.0 | ||
react-datetime v2.16.0 | ||
https://github.com/YouCanBookMe/react-datetime | ||
MIT: https://github.com/YouCanBookMe/react-datetime/raw/master/LICENSE | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("moment"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","moment","ReactDOM"],t):"object"==typeof exports?exports.Datetime=t(require("React"),require("moment"),require("ReactDOM")):e.Datetime=t(e.React,e.moment,e.ReactDOM)}(this,function(e,t,n){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(11),a=n(15),s=n(12),c=n(16),u=Object.freeze({YEARS:"years",MONTHS:"months",DAYS:"days",TIME:"time"}),l=o,p=i({displayName:"DateTime",propTypes:{onFocus:l.func,onBlur:l.func,onChange:l.func,onViewModeChange:l.func,onNavigateBack:l.func,onNavigateForward:l.func,locale:l.string,utc:l.bool,input:l.bool,inputProps:l.object,timeConstraints:l.object,viewMode:l.oneOf([u.YEARS,u.MONTHS,u.DAYS,u.TIME]),isValidDate:l.func,open:l.bool,strictParsing:l.bool,closeOnSelect:l.bool,closeOnTab:l.bool},getInitialState:function(){var e=this.getStateFromProps(this.props);return void 0===e.open&&(e.open=!this.props.input),e.currentView=this.props.dateFormat?this.props.viewMode||e.updateOn||u.DAYS:u.TIME,e},parseDate:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t.datetime):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n},getStateFromProps:function(e){var t,n,r,o,i=this.getFormats(e),a=e.value||e.defaultValue;return t=this.parseDate(a,i),n=this.parseDate(e.viewDate,i),n=t?t.clone().startOf("month"):n?n.clone().startOf("month"):this.localMoment().startOf("month"),r=this.getUpdateOn(i),o=t?t.format(i.datetime):a.isValid&&!a.isValid()?"":a||"",{updateOn:r,inputFormat:i.datetime,viewDate:n,selectedDate:t,inputValue:o,open:e.open}},getUpdateOn:function(e){return e.date.match(/[lLD]/)?u.DAYS:e.date.indexOf("M")!==-1?u.MONTHS:e.date.indexOf("Y")!==-1?u.YEARS:u.DAYS},getFormats:function(e){var t={date:e.dateFormat||"",time:e.timeFormat||""},n=this.localMoment(e.date,null,e).localeData();return t.date===!0?t.date=n.longDateFormat("L"):this.getUpdateOn(t)!==u.DAYS&&(t.time=""),t.time===!0&&(t.time=n.longDateFormat("LT")),t.datetime=t.date&&t.time?t.date+" "+t.time:t.date||t.time,t},componentWillReceiveProps:function(e){var t=this.getFormats(e),n={};if(e.value===this.props.value&&t.datetime===this.getFormats(this.props).datetime||(n=this.getStateFromProps(e)),void 0===n.open&&("undefined"!=typeof e.open?n.open=e.open:this.props.closeOnSelect&&this.state.currentView!==u.TIME?n.open=!1:n.open=this.state.open),e.viewMode!==this.props.viewMode&&(n.currentView=e.viewMode),e.locale!==this.props.locale){if(this.state.viewDate){var r=this.state.viewDate.clone().locale(e.locale);n.viewDate=r}if(this.state.selectedDate){var o=this.state.selectedDate.clone().locale(e.locale);n.selectedDate=o,n.inputValue=o.format(t.datetime)}}e.utc!==this.props.utc&&(e.utc?(this.state.viewDate&&(n.viewDate=this.state.viewDate.clone().utc()),this.state.selectedDate&&(n.selectedDate=this.state.selectedDate.clone().utc(),n.inputValue=n.selectedDate.format(t.datetime))):(this.state.viewDate&&(n.viewDate=this.state.viewDate.clone().local()),this.state.selectedDate&&(n.selectedDate=this.state.selectedDate.clone().local(),n.inputValue=n.selectedDate.format(t.datetime)))),e.viewDate!==this.props.viewDate&&(n.viewDate=a(e.viewDate)),this.setState(n)},onInputChange:function(e){var t=null===e.target?e:e.target.value,n=this.localMoment(t,this.state.inputFormat),r={inputValue:t};return n.isValid()&&!this.props.value?(r.selectedDate=n,r.viewDate=n.clone().startOf("month")):r.selectedDate=null,this.setState(r,function(){return this.props.onChange(n.isValid()?n:this.state.inputValue)})},onInputKey:function(e){9===e.which&&this.props.closeOnTab&&this.closeCalendar()},showView:function(e){var t=this;return function(){t.state.currentView!==e&&t.props.onViewModeChange(e),t.setState({currentView:e})}},setDate:function(e){var t=this,n={month:u.DAYS,year:u.MONTHS};return function(r){t.setState({viewDate:t.state.viewDate.clone()[e](parseInt(r.target.getAttribute("data-value"),10)).startOf(e),currentView:n[e]}),t.props.onViewModeChange(n[e])}},subtractTime:function(e,t,n){var r=this;return function(){r.props.onNavigateBack(e,t),r.updateTime("subtract",e,t,n)}},addTime:function(e,t,n){var r=this;return function(){r.props.onNavigateForward(e,t),r.updateTime("add",e,t,n)}},updateTime:function(e,t,n,r){var o={},i=r?"selectedDate":"viewDate";o[i]=this.state[i].clone()[e](t,n),this.setState(o)},allowedSetTime:["hours","minutes","seconds","milliseconds"],setTime:function(e,t){var n,r=this.allowedSetTime.indexOf(e)+1,o=this.state,i=(o.selectedDate||o.viewDate).clone();for(i[e](t);r<this.allowedSetTime.length;r++)n=this.allowedSetTime[r],i[n](i[n]());this.props.value||this.setState({selectedDate:i,inputValue:i.format(o.inputFormat)}),this.props.onChange(i)},updateSelectedDate:function(e,t){var n,r=e.target,o=0,i=this.state.viewDate,a=this.state.selectedDate||i;if(r.className.indexOf("rdtDay")!==-1?(r.className.indexOf("rdtNew")!==-1?o=1:r.className.indexOf("rdtOld")!==-1&&(o=-1),n=i.clone().month(i.month()+o).date(parseInt(r.getAttribute("data-value"),10))):r.className.indexOf("rdtMonth")!==-1?n=i.clone().month(parseInt(r.getAttribute("data-value"),10)).date(a.date()):r.className.indexOf("rdtYear")!==-1&&(n=i.clone().month(a.month()).date(a.date()).year(parseInt(r.getAttribute("data-value"),10))),n.hours(a.hours()).minutes(a.minutes()).seconds(a.seconds()).milliseconds(a.milliseconds()),this.props.value)this.props.closeOnSelect&&t&&this.closeCalendar();else{var s=!(this.props.closeOnSelect&&t);s||this.props.onBlur(n),this.setState({selectedDate:n,viewDate:n.clone().startOf("month"),inputValue:n.format(this.state.inputFormat),open:s})}this.props.onChange(n)},openCalendar:function(e){this.state.open||this.setState({open:!0},function(){this.props.onFocus(e)})},closeCalendar:function(){this.setState({open:!1},function(){this.props.onBlur(this.state.selectedDate||this.state.inputValue)})},handleClickOutside:function(){this.props.input&&this.state.open&&!this.props.open&&!this.props.disableOnClickOutside&&this.setState({open:!1},function(){this.props.onBlur(this.state.selectedDate||this.state.inputValue)})},localMoment:function(e,t,n){n=n||this.props;var r=n.utc?a.utc:a,o=r(e,t,n.strictParsing);return n.locale&&o.locale(n.locale),o},componentProps:{fromProps:["value","isValidDate","renderDay","renderMonth","renderYear","timeConstraints"],fromState:["viewDate","selectedDate","updateOn"],fromThis:["setDate","setTime","showView","addTime","subtractTime","updateSelectedDate","localMoment","handleClickOutside"]},getComponentProps:function(){var e=this,t=this.getFormats(this.props),n={dateFormat:t.date,timeFormat:t.time};return this.componentProps.fromProps.forEach(function(t){n[t]=e.props[t]}),this.componentProps.fromState.forEach(function(t){n[t]=e.state[t]}),this.componentProps.fromThis.forEach(function(t){n[t]=e[t]}),n},render:function(){var e="rdt"+(this.props.className?Array.isArray(this.props.className)?" "+this.props.className.join(" "):" "+this.props.className:""),t=[];if(this.props.input){var n=r({type:"text",className:"form-control",onClick:this.openCalendar,onFocus:this.openCalendar,onChange:this.onInputChange,onKeyDown:this.onInputKey,value:this.state.inputValue},this.props.inputProps);t=this.props.renderInput?[s.createElement("div",{key:"i"},this.props.renderInput(n,this.openCalendar,this.closeCalendar))]:[s.createElement("input",r({key:"i"},n))]}else e+=" rdtStatic";return this.state.open&&(e+=" rdtOpen"),s.createElement("div",{className:e},t.concat(s.createElement("div",{key:"dt",className:"rdtPicker"},s.createElement(c,{view:this.state.currentView,viewProps:this.getComponentProps(),onClickOutside:this.handleClickOutside}))))}});p.defaultProps={className:"",defaultValue:"",inputProps:{},input:!0,onFocus:function(){},onBlur:function(){},onChange:function(){},onViewModeChange:function(){},onNavigateBack:function(){},onNavigateForward:function(){},timeFormat:!0,timeConstraints:{},dateFormat:!0,strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,utc:!1},p.moment=a,e.exports=p},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter(function(t){return o.call(e,t)})}var o=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(e,t){for(var o,i,a=n(e),s=1;s<arguments.length;s++){o=arguments[s],i=r(Object(o));for(var c=0;c<i.length;c++)a[i[c]]=o[i[c]]}return a}},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},i=!0;e.exports=n(4)(o,i)}else e.exports=n(10)()}).call(t,n(3))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){m&&f&&(m=!1,f.length?h=f.concat(h):y=-1,h.length&&s())}function s(){if(!m){var e=o(a);m=!0;for(var t=h.length;t;){for(f=h,h=[];++y<t;)f&&f[y].run();y=-1,t=h.length}f=null,m=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function u(){}var l,p,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(e){p=r}}();var f,h=[],m=!1,y=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new c(e,t)),1!==h.length||m||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=u,d.addListener=u,d.once=u,d.off=u,d.removeListener=u,d.removeAllListeners=u,d.emit=u,d.prependListener=u,d.prependOnceListener=u,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,n){(function(t){"use strict";var r=n(5),o=n(6),i=n(7),a=n(8),s=n(9);e.exports=function(e,n){function c(e){var t=e&&(x&&e[x]||e[S]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function p(e){function r(r,u,p,d,f,h,m){if(d=d||T,h=h||p,m!==a)if(n)o(!1,"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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var y=d+":"+p;!s[y]&&c<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,d),s[y]=!0,c++)}return null==u[p]?r?new l(null===u[p]?"The "+f+" `"+h+"` is marked as required "+("in `"+d+"`, but its value is `null`."):"The "+f+" `"+h+"` is marked as required in "+("`"+d+"`, but its value is `undefined`.")):null:e(u,p,d,f,h)}if("production"!==t.env.NODE_ENV)var s={},c=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function d(e){function t(t,n,r,o,i,a){var s=t[n],c=N(s);if(c!==e){var u=w(s);return new l("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return p(t)}function f(){return p(r.thatReturnsNull)}function h(e){function t(t,n,r,o,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var c=N(s);return new l("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var u=0;u<s.length;u++){var p=e(s,u,r,o,i+"["+u+"]",a);if(p instanceof Error)return p}return null}return p(t)}function m(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){var s=N(a);return new l("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return p(t)}function y(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||T,s=_(t[n]);return new l("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return p(t)}function v(e){function n(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(u(a,e[s]))return null;var c=JSON.stringify(e);return new l("Invalid "+o+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+c+"."))}return Array.isArray(e)?p(n):("production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function E(e){function t(t,n,r,o,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],c=N(s);if("object"!==c)return new l("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an object."));for(var u in s)if(s.hasOwnProperty(u)){var p=e(s,u,r,o,i+"."+u,a);if(p instanceof Error)return p}return null}return p(t)}function D(e){function n(t,n,r,o,i){for(var s=0;s<e.length;s++){var c=e[s];if(null==c(t,n,r,o,i,a))return null}return new l("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull;for(var o=0;o<e.length;o++){var s=e[o];if("function"!=typeof s)return i(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",k(s),o),r.thatReturnsNull}return p(n)}function g(){function e(e,t,n,r,o){return b(e[t])?null:new l("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return p(e)}function O(e){function t(t,n,r,o,i){var s=t[n],c=N(s);if("object"!==c)return new l("Invalid "+o+" `"+i+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var u in e){var p=e[u];if(p){var d=p(s,u,r,o,i+"."+u,a);if(d)return d}}return null}return p(t)}function b(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(b);if(null===t||e(t))return!0;var n=c(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!b(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!b(i[1]))return!1}return!0;default:return!1}}function C(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function N(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":C(t,e)?"symbol":t}function w(e){if("undefined"==typeof e||null===e)return""+e;var t=N(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function k(e){var t=w(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function _(e){return e.constructor&&e.constructor.name?e.constructor.name:T}var x="function"==typeof Symbol&&Symbol.iterator,S="@@iterator",T="<<anonymous>>",M={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:f(),arrayOf:h,element:m(),instanceOf:y,node:g(),objectOf:E,oneOf:v,oneOfType:D,shape:O};return l.prototype=Error.prototype,M.checkPropTypes=s,M.PropTypes=M,M}}).call(t,n(3))},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){(function(t){"use strict";function n(e,t,n,o,i,a,s,c){if(r(t),!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,s,c],p=0;u=new Error(t.replace(/%s/g,function(){return l[p++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}var r=function(e){};"production"!==t.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(3))},function(e,t,n){(function(t){"use strict";var r=n(5),o=r;"production"!==t.env.NODE_ENV&&!function(){var e=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(a){}};o=function(t,n){if(void 0===n)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==n.indexOf("Failed Composite propType: ")&&!t){for(var r=arguments.length,o=Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];e.apply(void 0,[n].concat(o))}}}(),e.exports=o}).call(t,n(3))},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){(function(t){"use strict";function r(e,n,r,c,u){if("production"!==t.env.NODE_ENV)for(var l in e)if(e.hasOwnProperty(l)){var p;try{o("function"==typeof e[l],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",c||"React class",r,l),p=e[l](n,l,c,r,null,a)}catch(d){p=d}if(i(!p||p instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",c||"React class",r,l,typeof p),p instanceof Error&&!(p.message in s)){s[p.message]=!0;var f=u?u():"";i(!1,"Failed %s type: %s%s",r,p.message,null!=f?f:"")}}}if("production"!==t.env.NODE_ENV)var o=n(6),i=n(7),a=n(8),s={};e.exports=r}).call(t,n(3))},function(e,t,n){"use strict";var r=n(5),o=n(6),i=n(8);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"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")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=n(12),o=n(13);if("undefined"==typeof r)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new r.Component).updater;e.exports=o(r.Component,r.isValidElement,i)},function(t,n){t.exports=e},function(e,t,n){(function(t){"use strict";function r(e){return e}function o(e,n,o){function p(e,n,r){for(var o in n)n.hasOwnProperty(o)&&"production"!==t.env.NODE_ENV&&c("function"==typeof n[o],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[r],o)}function d(e,t){var n=b.hasOwnProperty(t)?b[t]:null;k.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function f(e,r){if(r){s("function"!=typeof r,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!n(r),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var o=e.prototype,i=o.__reactAutoBindPairs;r.hasOwnProperty(l)&&C.mixins(e,r.mixins);for(var a in r)if(r.hasOwnProperty(a)&&a!==l){var u=r[a],p=o.hasOwnProperty(a);if(d(p,a),C.hasOwnProperty(a))C[a](e,u);else{var f=b.hasOwnProperty(a),h="function"==typeof u,m=h&&!f&&!p&&r.autobind!==!1;if(m)i.push(a,u),o[a]=u;else if(p){var E=b[a];s(f&&("DEFINE_MANY_MERGED"===E||"DEFINE_MANY"===E),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",E,a),"DEFINE_MANY_MERGED"===E?o[a]=y(o[a],u):"DEFINE_MANY"===E&&(o[a]=v(o[a],u))}else o[a]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&r.displayName&&(o[a].displayName=r.displayName+"_"+a)}}}else if("production"!==t.env.NODE_ENV){var D=typeof r,g="object"===D&&null!==r;"production"!==t.env.NODE_ENV&&c(g,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===r?null:D)}}function h(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in C;s(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function m(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function y(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return m(o,n),m(o,r),o}}function v(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function E(e,n){var r=n.bind(e);if("production"!==t.env.NODE_ENV){r.__reactBoundContext=e,r.__reactBoundMethod=n,r.__reactBoundArguments=null;var o=e.constructor.displayName,i=r.bind;r.bind=function(a){for(var s=arguments.length,u=Array(s>1?s-1:0),l=1;l<s;l++)u[l-1]=arguments[l];if(a!==e&&null!==a)"production"!==t.env.NODE_ENV&&c(!1,"bind(): React component methods may only be bound to the component instance. See %s",o);else if(!u.length)return"production"!==t.env.NODE_ENV&&c(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",o),r;var p=i.apply(r,arguments);return p.__reactBoundContext=e,p.__reactBoundMethod=n,p.__reactBoundArguments=u,p}}return r}function D(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=E(e,o)}}function g(e){var n=r(function(e,r,i){"production"!==t.env.NODE_ENV&&c(this instanceof n,"Something is calling a React component directly. Use a factory or JSX instead. See: https://fb.me/react-legacyfactory"),this.__reactAutoBindPairs.length&&D(this),this.props=e,this.context=r,this.refs=a,this.updater=i||o,this.state=null;var u=this.getInitialState?this.getInitialState():null;"production"!==t.env.NODE_ENV&&void 0===u&&this.getInitialState._isMockFunction&&(u=null),s("object"==typeof u&&!Array.isArray(u),"%s.getInitialState(): must return an object or null",n.displayName||"ReactCompositeComponent"),this.state=u});n.prototype=new _,n.prototype.constructor=n,n.prototype.__reactAutoBindPairs=[],O.forEach(f.bind(null,n)),f(n,N),f(n,e),f(n,w),n.getDefaultProps&&(n.defaultProps=n.getDefaultProps()),"production"!==t.env.NODE_ENV&&(n.getDefaultProps&&(n.getDefaultProps.isReactClassApproved={}),n.prototype.getInitialState&&(n.prototype.getInitialState.isReactClassApproved={})),s(n.prototype.render,"createClass(...): Class specification must implement a `render` method."),"production"!==t.env.NODE_ENV&&(c(!n.prototype.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",e.displayName||"A component"),c(!n.prototype.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",e.displayName||"A component"));for(var i in b)n.prototype[i]||(n.prototype[i]=null);return n}var O=[],b={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},C={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)f(e,t[n])},childContextTypes:function(e,n){"production"!==t.env.NODE_ENV&&p(e,n,"childContext"),e.childContextTypes=i({},e.childContextTypes,n)},contextTypes:function(e,n){"production"!==t.env.NODE_ENV&&p(e,n,"context"),e.contextTypes=i({},e.contextTypes,n)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=y(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,n){"production"!==t.env.NODE_ENV&&p(e,n,"prop"),e.propTypes=i({},e.propTypes,n)},statics:function(e,t){h(e,t)},autobind:function(){}},N={componentDidMount:function(){this.__isMounted=!0}},w={componentWillUnmount:function(){this.__isMounted=!1}},k={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return"production"!==t.env.NODE_ENV&&(c(this.__didWarnIsMounted,"%s: isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.",this.constructor&&this.constructor.displayName||this.name||"Component"),this.__didWarnIsMounted=!0),!!this.__isMounted}},_=function(){};return i(_.prototype,e.prototype,k),g}var i=n(1),a=n(14),s=n(6);if("production"!==t.env.NODE_ENV)var c=n(7);var u,l="mixins";u="production"!==t.env.NODE_ENV?{prop:"prop",context:"context",childContext:"child context"}:{},e.exports=o}).call(t,n(3))},function(e,t,n){(function(t){"use strict";var n={};"production"!==t.env.NODE_ENV&&Object.freeze(n),e.exports=n}).call(t,n(3))},function(e,n){e.exports=t},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(17),a=n(21),s=n(22),c=n(23),u=o({viewComponents:{days:i,months:a,years:s,time:c},render:function(){return r.createElement(this.viewComponents[this.props.view],this.props.viewProps)}});e.exports=u},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(15),a=n(18)["default"],s=a(o({render:function(){var e,t=this.renderFooter(),n=this.props.viewDate,o=n.localeData();return e=[r.createElement("thead",{key:"th"},[r.createElement("tr",{key:"h"},[r.createElement("th",{key:"p",className:"rdtPrev",onClick:this.props.subtractTime(1,"months")},r.createElement("span",{},"‹")),r.createElement("th",{key:"s",className:"rdtSwitch",onClick:this.props.showView("months"),colSpan:5,"data-value":this.props.viewDate.month()},o.months(n)+" "+n.year()),r.createElement("th",{key:"n",className:"rdtNext",onClick:this.props.addTime(1,"months")},r.createElement("span",{},"›"))]),r.createElement("tr",{key:"d"},this.getDaysOfWeek(o).map(function(e,t){return r.createElement("th",{key:e+t,className:"dow"},e)}))]),r.createElement("tbody",{key:"tb"},this.renderDays())],t&&e.push(t),r.createElement("div",{className:"rdtDays"},r.createElement("table",{},e))},getDaysOfWeek:function(e){var t=e._weekdaysMin,n=e.firstDayOfWeek(),r=[],o=0;return t.forEach(function(e){r[(7+o++-n)%7]=e}),r},renderDays:function(){var e,t,n,o,a=this.props.viewDate,s=this.props.selectedDate&&this.props.selectedDate.clone(),c=a.clone().subtract(1,"months"),u=a.year(),l=a.month(),p=[],d=[],f=this.props.renderDay||this.renderDay,h=this.props.isValidDate||this.alwaysValidDate;c.date(c.daysInMonth()).startOf("week");for(var m=c.clone().add(42,"d");c.isBefore(m);)e="rdtDay",o=c.clone(),c.year()===u&&c.month()<l||c.year()<u?e+=" rdtOld":(c.year()===u&&c.month()>l||c.year()>u)&&(e+=" rdtNew"),s&&c.isSame(s,"day")&&(e+=" rdtActive"),c.isSame(i(),"day")&&(e+=" rdtToday"),t=!h(o,s),t&&(e+=" rdtDisabled"),n={key:c.format("M_D"),"data-value":c.date(),className:e},t||(n.onClick=this.updateSelectedDate),d.push(f(n,o,s)),7===d.length&&(p.push(r.createElement("tr",{key:c.format("M_D")},d)),d=[]),c.add(1,"d");return p},updateSelectedDate:function(e){this.props.updateSelectedDate(e,!0)},renderDay:function(e,t){return r.createElement("td",e,t.date())},renderFooter:function(){if(!this.props.timeFormat)return"";var e=this.props.selectedDate||this.props.viewDate;return r.createElement("tfoot",{key:"tf"},r.createElement("tr",{},r.createElement("td",{onClick:this.props.showView("time"),colSpan:7,className:"rdtTimeToggle"},e.format(this.props.timeFormat))))},alwaysValidDate:function(){return 1},handleClickOutside:function(){this.props.handleClickOutside()}}));e.exports=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){var n,r;return r=n=function(n){function r(){var e,t,a;o(this,r);for(var s=arguments.length,c=Array(s),u=0;u<s;u++)c[u]=arguments[u];return e=t=i(this,n.call.apply(n,[this].concat(c))),t.__outsideClickHandler=null,t.enableOnClickOutside=function(){var e=t.__outsideClickHandler;if(e&&"undefined"!=typeof document){var n=t.props.eventTypes;n.forEach||(n=[n]),n.forEach(function(n){var r=null,o=h.indexOf(n)!==-1;o&&(r={passive:!t.props.preventDefault}),document.addEventListener(n,e,r)})}},t.disableOnClickOutside=function(){var e=t.__outsideClickHandler;if(e&&"undefined"!=typeof document){var n=t.props.eventTypes;n.forEach||(n=[n]),n.forEach(function(t){return document.removeEventListener(t,e)})}},t.getRef=function(e){return t.instanceRef=e},a=e,i(t,a)}return a(r,n),r.prototype.getInstance=function(){if(!e.prototype.isReactComponent)return this;var t=this.instanceRef;return t.getInstance?t.getInstance():t},r.prototype.componentDidMount=function(){if("undefined"!=typeof document&&document.createElement){var e=this.getInstance();if(t&&"function"==typeof t.handleClickOutside){if(this.__clickOutsideHandlerProp=t.handleClickOutside(e),"function"!=typeof this.__clickOutsideHandlerProp)throw new Error("WrappedComponent lacks a function for processing outside click events specified by the handleClickOutside config option."); | ||
}else if("function"==typeof e.handleClickOutside)c.Component.prototype.isPrototypeOf(e)?this.__clickOutsideHandlerProp=e.handleClickOutside.bind(e):this.__clickOutsideHandlerProp=e.handleClickOutside;else{if("function"!=typeof e.props.handleClickOutside)throw new Error("WrappedComponent lacks a handleClickOutside(event) function for processing outside click events.");this.__clickOutsideHandlerProp=e.props.handleClickOutside}null!==(0,u.findDOMNode)(e)&&this.addOutsideClickHandler()}},r.prototype.componentWillReceiveProps=function(e){this.props.disableOnClickOutside&&!e.disableOnClickOutside?this.enableOnClickOutside():!this.props.disableOnClickOutside&&e.disableOnClickOutside&&this.disableOnClickOutside()},r.prototype.componentDidUpdate=function(){var e=(0,u.findDOMNode)(this.getInstance());return null===e&&this.__outsideClickHandler?void this.removeOutsideClickHandler():null===e||this.__outsideClickHandler?void 0:void this.addOutsideClickHandler()},r.prototype.componentWillUnmount=function(){this.removeOutsideClickHandler()},r.prototype.addOutsideClickHandler=function(){var e=this.__outsideClickHandler=(0,p["default"])((0,u.findDOMNode)(this.getInstance()),this.__clickOutsideHandlerProp,this.props.outsideClickIgnoreClass,this.props.excludeScrollbar,this.props.preventDefault,this.props.stopPropagation),t=d.length;d.push(this),f[t]=e,this.props.disableOnClickOutside||this.enableOnClickOutside()},r.prototype.removeOutsideClickHandler=function(){this.disableOnClickOutside(),this.__outsideClickHandler=!1;var e=d.indexOf(this);e>-1&&(f[e]&&f.splice(e,1),d.splice(e,1))},r.prototype.render=function(){var t=this,n=Object.keys(this.props).filter(function(e){return"excludeScrollbar"!==e}).reduce(function(e,n){return e[n]=t.props[n],e},{});return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,(0,c.createElement)(e,n)},r}(c.Component),n.displayName="OnClickOutside("+(e.displayName||e.name||"Component")+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:m,preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r}t.__esModule=!0,t.IGNORE_CLASS_NAME=void 0,t["default"]=s;var c=n(12),u=n(19),l=n(20),p=r(l),d=[],f=[],h=["touchstart","touchmove"],m=t.IGNORE_CLASS_NAME="ignore-react-onclickoutside"},function(e,t){e.exports=n},function(e,t){"use strict";function n(e,t,n){return e===t||(e.correspondingElement?e.correspondingElement.classList.contains(n):e.classList.contains(n))}function r(e,t,r){if(e===t)return!0;for(;e.parentNode;){if(n(e,t,r))return!0;e=e.parentNode}return e}function o(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY}function i(e,t,n,i,a,s){return function(c){a&&c.preventDefault(),s&&c.stopPropagation();var u=c.target;i&&o(c)||r(u,e,n)!==document||t(c)}}t.__esModule=!0,t["default"]=i},function(e,t,n){"use strict";function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}var o=n(12),i=n(11),a=n(18)["default"],s=a(i({render:function(){return o.createElement("div",{className:"rdtMonths"},[o.createElement("table",{key:"a"},o.createElement("thead",{},o.createElement("tr",{},[o.createElement("th",{key:"prev",className:"rdtPrev",onClick:this.props.subtractTime(1,"years")},o.createElement("span",{},"‹")),o.createElement("th",{key:"year",className:"rdtSwitch",onClick:this.props.showView("years"),colSpan:2,"data-value":this.props.viewDate.year()},this.props.viewDate.year()),o.createElement("th",{key:"next",className:"rdtNext",onClick:this.props.addTime(1,"years")},o.createElement("span",{},"›"))]))),o.createElement("table",{key:"months"},o.createElement("tbody",{key:"b"},this.renderMonths()))])},renderMonths:function(){for(var e,t,n,r,i,a,s,c=this.props.selectedDate,u=this.props.viewDate.month(),l=this.props.viewDate.year(),p=[],d=0,f=[],h=this.props.renderMonth||this.renderMonth,m=this.props.isValidDate||this.alwaysValidDate,y=1;d<12;)e="rdtMonth",n=this.props.viewDate.clone().set({year:l,month:d,date:y}),i=n.endOf("month").format("D"),a=Array.from({length:i},function(e,t){return t+1}),s=a.find(function(e){var t=n.clone().set("date",e);return m(t)}),r=void 0===s,r&&(e+=" rdtDisabled"),c&&d===c.month()&&l===c.year()&&(e+=" rdtActive"),t={key:d,"data-value":d,className:e},r||(t.onClick="months"===this.props.updateOn?this.updateSelectedMonth:this.props.setDate("month")),f.push(h(t,d,l,c&&c.clone())),4===f.length&&(p.push(o.createElement("tr",{key:u+"_"+p.length},f)),f=[]),d++;return p},updateSelectedMonth:function(e){this.props.updateSelectedDate(e)},renderMonth:function(e,t){var n=this.props.viewDate,i=n.localeData().monthsShort(n.month(t)),a=3,s=i.substring(0,a);return o.createElement("td",e,r(s))},alwaysValidDate:function(){return 1},handleClickOutside:function(){this.props.handleClickOutside()}}));e.exports=s},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(18)["default"],a=i(o({render:function(){var e=10*parseInt(this.props.viewDate.year()/10,10);return r.createElement("div",{className:"rdtYears"},[r.createElement("table",{key:"a"},r.createElement("thead",{},r.createElement("tr",{},[r.createElement("th",{key:"prev",className:"rdtPrev",onClick:this.props.subtractTime(10,"years")},r.createElement("span",{},"‹")),r.createElement("th",{key:"year",className:"rdtSwitch",onClick:this.props.showView("years"),colSpan:2},e+"-"+(e+9)),r.createElement("th",{key:"next",className:"rdtNext",onClick:this.props.addTime(10,"years")},r.createElement("span",{},"›"))]))),r.createElement("table",{key:"years"},r.createElement("tbody",{},this.renderYears(e)))])},renderYears:function(e){var t,n,o,i,a,s,c,u=[],l=-1,p=[],d=this.props.renderYear||this.renderYear,f=this.props.selectedDate,h=this.props.isValidDate||this.alwaysValidDate,m=0,y=1;for(e--;l<11;)t="rdtYear",o=this.props.viewDate.clone().set({year:e,month:m,date:y}),a=o.endOf("year").format("DDD"),s=Array.from({length:a},function(e,t){return t+1}),c=s.find(function(e){var t=o.clone().dayOfYear(e);return h(t)}),i=void 0===c,i&&(t+=" rdtDisabled"),f&&f.year()===e&&(t+=" rdtActive"),n={key:e,"data-value":e,className:t},i||(n.onClick="years"===this.props.updateOn?this.updateSelectedYear:this.props.setDate("year")),u.push(d(n,e,f&&f.clone())),4===u.length&&(p.push(r.createElement("tr",{key:l},u)),u=[]),e++,l++;return p},updateSelectedYear:function(e){this.props.updateSelectedDate(e)},renderYear:function(e,t){return r.createElement("td",e,t)},alwaysValidDate:function(){return 1},handleClickOutside:function(){this.props.handleClickOutside()}}));e.exports=a},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(1),a=n(18)["default"],s=a(o({getInitialState:function(){return this.calculateState(this.props)},calculateState:function(e){var t=e.selectedDate||e.viewDate,n=e.timeFormat,r=[];n.toLowerCase().indexOf("h")!==-1&&(r.push("hours"),n.indexOf("m")!==-1&&(r.push("minutes"),n.indexOf("s")!==-1&&r.push("seconds")));var o=t.format("H"),i=!1;return null!==this.state&&this.props.timeFormat.toLowerCase().indexOf(" a")!==-1&&(i=this.props.timeFormat.indexOf(" A")!==-1?o>=12?"PM":"AM":o>=12?"pm":"am"),{hours:o,minutes:t.format("mm"),seconds:t.format("ss"),milliseconds:t.format("SSS"),daypart:i,counters:r}},renderCounter:function(e){if("daypart"!==e){var t=this.state[e];return"hours"===e&&this.props.timeFormat.toLowerCase().indexOf(" a")!==-1&&(t=(t-1)%12+1,0===t&&(t=12)),r.createElement("div",{key:e,className:"rdtCounter"},[r.createElement("span",{key:"up",className:"rdtBtn",onMouseDown:this.onStartClicking("increase",e),onContextMenu:this.disableContextMenu},"▲"),r.createElement("div",{key:"c",className:"rdtCount"},t),r.createElement("span",{key:"do",className:"rdtBtn",onMouseDown:this.onStartClicking("decrease",e),onContextMenu:this.disableContextMenu},"▼")])}return""},renderDayPart:function(){return r.createElement("div",{key:"dayPart",className:"rdtCounter"},[r.createElement("span",{key:"up",className:"rdtBtn",onMouseDown:this.onStartClicking("toggleDayPart","hours"),onContextMenu:this.disableContextMenu},"▲"),r.createElement("div",{key:this.state.daypart,className:"rdtCount"},this.state.daypart),r.createElement("span",{key:"do",className:"rdtBtn",onMouseDown:this.onStartClicking("toggleDayPart","hours"),onContextMenu:this.disableContextMenu},"▼")])},render:function(){var e=this,t=[];return this.state.counters.forEach(function(n){t.length&&t.push(r.createElement("div",{key:"sep"+t.length,className:"rdtCounterSeparator"},":")),t.push(e.renderCounter(n))}),this.state.daypart!==!1&&t.push(e.renderDayPart()),3===this.state.counters.length&&this.props.timeFormat.indexOf("S")!==-1&&(t.push(r.createElement("div",{className:"rdtCounterSeparator",key:"sep5"},":")),t.push(r.createElement("div",{className:"rdtCounter rdtMilli",key:"m"},r.createElement("input",{value:this.state.milliseconds,type:"text",onChange:this.updateMilli})))),r.createElement("div",{className:"rdtTime"},r.createElement("table",{},[this.renderHeader(),r.createElement("tbody",{key:"b"},r.createElement("tr",{},r.createElement("td",{},r.createElement("div",{className:"rdtCounters"},t))))]))},componentWillMount:function(){var e=this;e.timeConstraints={hours:{min:0,max:23,step:1},minutes:{min:0,max:59,step:1},seconds:{min:0,max:59,step:1},milliseconds:{min:0,max:999,step:1}},["hours","minutes","seconds","milliseconds"].forEach(function(t){i(e.timeConstraints[t],e.props.timeConstraints[t])}),this.setState(this.calculateState(this.props))},componentWillReceiveProps:function(e){this.setState(this.calculateState(e))},updateMilli:function(e){var t=parseInt(e.target.value,10);t===e.target.value&&t>=0&&t<1e3&&(this.props.setTime("milliseconds",t),this.setState({milliseconds:t}))},renderHeader:function(){if(!this.props.dateFormat)return null;var e=this.props.selectedDate||this.props.viewDate;return r.createElement("thead",{key:"h"},r.createElement("tr",{},r.createElement("th",{className:"rdtSwitch",colSpan:4,onClick:this.props.showView("days")},e.format(this.props.dateFormat))))},onStartClicking:function(e,t){var n=this;return function(){var r={};r[t]=n[e](t),n.setState(r),n.timer=setTimeout(function(){n.increaseTimer=setInterval(function(){r[t]=n[e](t),n.setState(r)},70)},500),n.mouseUpListener=function(){clearTimeout(n.timer),clearInterval(n.increaseTimer),n.props.setTime(t,n.state[t]),document.body.removeEventListener("mouseup",n.mouseUpListener),document.body.removeEventListener("touchend",n.mouseUpListener)},document.body.addEventListener("mouseup",n.mouseUpListener),document.body.addEventListener("touchend",n.mouseUpListener)}},disableContextMenu:function(e){return e.preventDefault(),!1},padValues:{hours:1,minutes:2,seconds:2,milliseconds:3},toggleDayPart:function(e){var t=parseInt(this.state[e],10)+12;return t>this.timeConstraints[e].max&&(t=this.timeConstraints[e].min+(t-(this.timeConstraints[e].max+1))),this.pad(e,t)},increase:function(e){var t=parseInt(this.state[e],10)+this.timeConstraints[e].step;return t>this.timeConstraints[e].max&&(t=this.timeConstraints[e].min+(t-(this.timeConstraints[e].max+1))),this.pad(e,t)},decrease:function(e){var t=parseInt(this.state[e],10)-this.timeConstraints[e].step;return t<this.timeConstraints[e].min&&(t=this.timeConstraints[e].max+1-(this.timeConstraints[e].min-t)),this.pad(e,t)},pad:function(e,t){for(var n=t+"";n.length<this.padValues[e];)n="0"+n;return n},handleClickOutside:function(){this.props.handleClickOutside()}}));e.exports=s}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("moment"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","moment","ReactDOM"],t):"object"==typeof exports?exports.Datetime=t(require("React"),require("moment"),require("ReactDOM")):e.Datetime=t(e.React,e.moment,e.ReactDOM)}(this,function(e,t,n){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(11),a=n(16),s=n(12),c=n(17),u=n(22)["default"],l=Object.freeze({YEARS:"years",MONTHS:"months",DAYS:"days",TIME:"time"}),p=o,d=i({displayName:"DateTime",propTypes:{onFocus:p.func,onBlur:p.func,onChange:p.func,onViewModeChange:p.func,onNavigateBack:p.func,onNavigateForward:p.func,locale:p.string,utc:p.bool,displayTimeZone:p.string,input:p.bool,inputProps:p.object,timeConstraints:p.object,viewMode:p.oneOf([l.YEARS,l.MONTHS,l.DAYS,l.TIME]),isValidDate:p.func,open:p.bool,strictParsing:p.bool,closeOnSelect:p.bool,closeOnTab:p.bool},getInitialState:function(){var e=this.getStateFromProps(this.props);return void 0===e.open&&(e.open=!this.props.input),e.currentView=this.props.dateFormat?this.props.viewMode||e.updateOn||l.DAYS:l.TIME,e},parseDate:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t.datetime):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n},getStateFromProps:function(e){var t,n,r,o,i=this.getFormats(e),a=e.value||e.defaultValue;return t=this.parseDate(a,i),n=this.parseDate(e.viewDate,i),n=t?t.clone().startOf("month"):n?n.clone().startOf("month"):this.localMoment().startOf("month"),r=this.getUpdateOn(i),o=t?t.format(i.datetime):a.isValid&&!a.isValid()?"":a||"",{updateOn:r,inputFormat:i.datetime,viewDate:n,selectedDate:t,inputValue:o,open:e.open}},getUpdateOn:function(e){return e.date.match(/[lLD]/)?l.DAYS:e.date.indexOf("M")!==-1?l.MONTHS:e.date.indexOf("Y")!==-1?l.YEARS:l.DAYS},getFormats:function(e){var t={date:e.dateFormat||"",time:e.timeFormat||""},n=this.localMoment(e.date,null,e).localeData();return t.date===!0?t.date=n.longDateFormat("L"):this.getUpdateOn(t)!==l.DAYS&&(t.time=""),t.time===!0&&(t.time=n.longDateFormat("LT")),t.datetime=t.date&&t.time?t.date+" "+t.time:t.date||t.time,t},componentWillReceiveProps:function(e){var t=this.getFormats(e),n={};if(e.value===this.props.value&&t.datetime===this.getFormats(this.props).datetime||(n=this.getStateFromProps(e)),void 0===n.open&&("undefined"!=typeof e.open?n.open=e.open:this.props.closeOnSelect&&this.state.currentView!==l.TIME?n.open=!1:n.open=this.state.open),e.viewMode!==this.props.viewMode&&(n.currentView=e.viewMode),e.locale!==this.props.locale){if(this.state.viewDate){var r=this.state.viewDate.clone().locale(e.locale);n.viewDate=r}if(this.state.selectedDate){var o=this.state.selectedDate.clone().locale(e.locale);n.selectedDate=o,n.inputValue=o.format(t.datetime)}}e.utc===this.props.utc&&e.displayTimeZone===this.props.displayTimeZone||(e.utc?(this.state.viewDate&&(n.viewDate=this.state.viewDate.clone().utc()),this.state.selectedDate&&(n.selectedDate=this.state.selectedDate.clone().utc(),n.inputValue=n.selectedDate.format(t.datetime))):e.displayTimeZone?(this.state.viewDate&&(n.viewDate=this.state.viewDate.clone().tz(e.displayTimeZone)),this.state.selectedDate&&(n.selectedDate=this.state.selectedDate.clone().tz(e.displayTimeZone),n.inputValue=n.selectedDate.tz(e.displayTimeZone).format(t.datetime))):(this.state.viewDate&&(n.viewDate=this.state.viewDate.clone().local()),this.state.selectedDate&&(n.selectedDate=this.state.selectedDate.clone().local(),n.inputValue=n.selectedDate.format(t.datetime)))),e.viewDate!==this.props.viewDate&&(n.viewDate=a(e.viewDate)),this.setState(n)},onInputChange:function(e){var t=null===e.target?e:e.target.value,n=this.localMoment(t,this.state.inputFormat),r={inputValue:t};return n.isValid()&&!this.props.value?(r.selectedDate=n,r.viewDate=n.clone().startOf("month")):r.selectedDate=null,this.setState(r,function(){return this.props.onChange(n.isValid()?n:this.state.inputValue)})},onInputKey:function(e){9===e.which&&this.props.closeOnTab&&this.closeCalendar()},showView:function(e){var t=this;return function(){t.state.currentView!==e&&t.props.onViewModeChange(e),t.setState({currentView:e})}},setDate:function(e){var t=this,n={month:l.DAYS,year:l.MONTHS};return function(r){t.setState({viewDate:t.state.viewDate.clone()[e](parseInt(r.target.getAttribute("data-value"),10)).startOf(e),currentView:n[e]}),t.props.onViewModeChange(n[e])}},subtractTime:function(e,t,n){var r=this;return function(){r.props.onNavigateBack(e,t),r.updateTime("subtract",e,t,n)}},addTime:function(e,t,n){var r=this;return function(){r.props.onNavigateForward(e,t),r.updateTime("add",e,t,n)}},updateTime:function(e,t,n,r){var o={},i=r?"selectedDate":"viewDate";o[i]=this.state[i].clone()[e](t,n),this.setState(o)},allowedSetTime:["hours","minutes","seconds","milliseconds"],setTime:function(e,t){var n,r=this.allowedSetTime.indexOf(e)+1,o=this.state,i=(o.selectedDate||o.viewDate).clone();for(i[e](t);r<this.allowedSetTime.length;r++)n=this.allowedSetTime[r],i[n](i[n]());this.props.value||this.setState({selectedDate:i,inputValue:i.format(o.inputFormat)}),this.props.onChange(i)},updateSelectedDate:function(e,t){var n,r=e.currentTarget,o=0,i=this.state.viewDate,a=this.state.selectedDate||i;if(r.className.indexOf("rdtDay")!==-1?(r.className.indexOf("rdtNew")!==-1?o=1:r.className.indexOf("rdtOld")!==-1&&(o=-1),n=i.clone().month(i.month()+o).date(parseInt(r.getAttribute("data-value"),10))):r.className.indexOf("rdtMonth")!==-1?n=i.clone().month(parseInt(r.getAttribute("data-value"),10)).date(a.date()):r.className.indexOf("rdtYear")!==-1&&(n=i.clone().month(a.month()).date(a.date()).year(parseInt(r.getAttribute("data-value"),10))),n.hours(a.hours()).minutes(a.minutes()).seconds(a.seconds()).milliseconds(a.milliseconds()),this.props.value)this.props.closeOnSelect&&t&&this.closeCalendar();else{var s=!(this.props.closeOnSelect&&t);s||this.props.onBlur(n),this.setState({selectedDate:n,viewDate:n.clone().startOf("month"),inputValue:n.format(this.state.inputFormat),open:s})}this.props.onChange(n)},openCalendar:function(e){this.state.open||this.setState({open:!0},function(){this.props.onFocus(e)})},closeCalendar:function(){this.setState({open:!1},function(){this.props.onBlur(this.state.selectedDate||this.state.inputValue)})},handleClickOutside:function(){this.props.input&&this.state.open&&void 0===this.props.open&&!this.props.disableCloseOnClickOutside&&this.setState({open:!1},function(){this.props.onBlur(this.state.selectedDate||this.state.inputValue)})},localMoment:function(e,t,n){n=n||this.props;var r=null;return r=n.utc?a.utc(e,t,n.strictParsing):n.displayTimeZone?a.tz(e,t,n.displayTimeZone):a(e,t,n.strictParsing),n.locale&&r.locale(n.locale),r},componentProps:{fromProps:["value","isValidDate","renderDay","renderMonth","renderYear","timeConstraints"],fromState:["viewDate","selectedDate","updateOn"],fromThis:["setDate","setTime","showView","addTime","subtractTime","updateSelectedDate","localMoment","handleClickOutside"]},getComponentProps:function(){var e=this,t=this.getFormats(this.props),n={dateFormat:t.date,timeFormat:t.time};return this.componentProps.fromProps.forEach(function(t){n[t]=e.props[t]}),this.componentProps.fromState.forEach(function(t){n[t]=e.state[t]}),this.componentProps.fromThis.forEach(function(t){n[t]=e[t]}),n},overrideEvent:function(e,t){if(this.overridenEvents||(this.overridenEvents={}),!this.overridenEvents[e]){var n=this;this.overridenEvents[e]=function(r){var o;n.props.inputProps&&n.props.inputProps[e]&&(o=n.props.inputProps[e](r)),o!==!1&&t(r)}}return this.overridenEvents[e]},render:function(){var e="rdt"+(this.props.className?Array.isArray(this.props.className)?" "+this.props.className.join(" "):" "+this.props.className:""),t=[];if(this.props.input){var n=r({type:"text",className:"form-control",onClick:this.overrideEvent("onClick",this.openCalendar),onFocus:this.overrideEvent("onFocus",this.openCalendar),onChange:this.overrideEvent("onChange",this.onInputChange),onKeyDown:this.overrideEvent("onKeyDown",this.onInputKey),value:this.state.inputValue},this.props.inputProps);t=this.props.renderInput?[s.createElement("div",{key:"i"},this.props.renderInput(n,this.openCalendar,this.closeCalendar))]:[s.createElement("input",r({key:"i"},n))]}else e+=" rdtStatic";return(this.props.open||void 0===this.props.open&&this.state.open)&&(e+=" rdtOpen"),s.createElement(f,{className:e,onClickOut:this.handleClickOutside},t.concat(s.createElement("div",{key:"dt",className:"rdtPicker"},s.createElement(c,{view:this.state.currentView,viewProps:this.getComponentProps()}))))}}),f=u(i({render:function(){return s.createElement("div",{className:this.props.className},this.props.children)},handleClickOutside:function(e){this.props.onClickOut(e)}}));d.defaultProps={className:"",defaultValue:"",inputProps:{},input:!0,onFocus:function(){},onBlur:function(){},onChange:function(){},onViewModeChange:function(){},onNavigateBack:function(){},onNavigateForward:function(){},timeFormat:!0,timeConstraints:{},dateFormat:!0,strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,utc:!1},d.moment=a,e.exports=d},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter(function(t){return o.call(e,t)})}var o=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(e,t){for(var o,i,a=n(e),s=1;s<arguments.length;s++){o=arguments[s],i=r(Object(o));for(var c=0;c<i.length;c++)a[i[c]]=o[i[c]]}return a}},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},i=!0;e.exports=n(4)(o,i)}else e.exports=n(10)()}).call(t,n(3))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){m&&f&&(m=!1,f.length?h=f.concat(h):y=-1,h.length&&s())}function s(){if(!m){var e=o(a);m=!0;for(var t=h.length;t;){for(f=h,h=[];++y<t;)f&&f[y].run();y=-1,t=h.length}f=null,m=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function u(){}var l,p,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(e){p=r}}();var f,h=[],m=!1,y=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new c(e,t)),1!==h.length||m||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=u,d.addListener=u,d.once=u,d.off=u,d.removeListener=u,d.removeAllListeners=u,d.emit=u,d.prependListener=u,d.prependOnceListener=u,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,n){(function(t){"use strict";var r=n(5),o=n(6),i=n(7),a=n(8),s=n(9);e.exports=function(e,n){function c(e){var t=e&&(x&&e[x]||e[S]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function p(e){function r(r,u,p,d,f,h,m){if(d=d||T,h=h||p,m!==a)if(n)o(!1,"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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var y=d+":"+p;!s[y]&&c<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,d),s[y]=!0,c++)}return null==u[p]?r?new l(null===u[p]?"The "+f+" `"+h+"` is marked as required "+("in `"+d+"`, but its value is `null`."):"The "+f+" `"+h+"` is marked as required in "+("`"+d+"`, but its value is `undefined`.")):null:e(u,p,d,f,h)}if("production"!==t.env.NODE_ENV)var s={},c=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function d(e){function t(t,n,r,o,i,a){var s=t[n],c=N(s);if(c!==e){var u=C(s);return new l("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return p(t)}function f(){return p(r.thatReturnsNull)}function h(e){function t(t,n,r,o,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var c=N(s);return new l("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var u=0;u<s.length;u++){var p=e(s,u,r,o,i+"["+u+"]",a);if(p instanceof Error)return p}return null}return p(t)}function m(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){var s=N(a);return new l("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return p(t)}function y(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||T,s=_(t[n]);return new l("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return p(t)}function v(e){function n(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(u(a,e[s]))return null;var c=JSON.stringify(e);return new l("Invalid "+o+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+c+"."))}return Array.isArray(e)?p(n):("production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function E(e){function t(t,n,r,o,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],c=N(s);if("object"!==c)return new l("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an object."));for(var u in s)if(s.hasOwnProperty(u)){var p=e(s,u,r,o,i+"."+u,a);if(p instanceof Error)return p}return null}return p(t)}function g(e){function n(t,n,r,o,i){for(var s=0;s<e.length;s++){var c=e[s];if(null==c(t,n,r,o,i,a))return null}return new l("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull;for(var o=0;o<e.length;o++){var s=e[o];if("function"!=typeof s)return i(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",k(s),o),r.thatReturnsNull}return p(n)}function D(){function e(e,t,n,r,o){return b(e[t])?null:new l("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return p(e)}function O(e){function t(t,n,r,o,i){var s=t[n],c=N(s);if("object"!==c)return new l("Invalid "+o+" `"+i+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var u in e){var p=e[u];if(p){var d=p(s,u,r,o,i+"."+u,a);if(d)return d}}return null}return p(t)}function b(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(b);if(null===t||e(t))return!0;var n=c(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!b(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!b(i[1]))return!1}return!0;default:return!1}}function w(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function N(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":w(t,e)?"symbol":t}function C(e){if("undefined"==typeof e||null===e)return""+e;var t=N(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function k(e){var t=C(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function _(e){return e.constructor&&e.constructor.name?e.constructor.name:T}var x="function"==typeof Symbol&&Symbol.iterator,S="@@iterator",T="<<anonymous>>",M={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:f(),arrayOf:h,element:m(),instanceOf:y,node:D(),objectOf:E,oneOf:v,oneOfType:g,shape:O};return l.prototype=Error.prototype,M.checkPropTypes=s,M.PropTypes=M,M}}).call(t,n(3))},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){(function(t){"use strict";function n(e,t,n,o,i,a,s,c){if(r(t),!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,s,c],p=0;u=new Error(t.replace(/%s/g,function(){return l[p++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}var r=function(e){};"production"!==t.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(3))},function(e,t,n){(function(t){"use strict";var r=n(5),o=r;"production"!==t.env.NODE_ENV&&!function(){var e=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(a){}};o=function(t,n){if(void 0===n)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==n.indexOf("Failed Composite propType: ")&&!t){for(var r=arguments.length,o=Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];e.apply(void 0,[n].concat(o))}}}(),e.exports=o}).call(t,n(3))},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){(function(t){"use strict";function r(e,n,r,c,u){if("production"!==t.env.NODE_ENV)for(var l in e)if(e.hasOwnProperty(l)){var p;try{o("function"==typeof e[l],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",c||"React class",r,l),p=e[l](n,l,c,r,null,a)}catch(d){p=d}if(i(!p||p instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",c||"React class",r,l,typeof p),p instanceof Error&&!(p.message in s)){s[p.message]=!0;var f=u?u():"";i(!1,"Failed %s type: %s%s",r,p.message,null!=f?f:"")}}}if("production"!==t.env.NODE_ENV)var o=n(6),i=n(7),a=n(8),s={};e.exports=r}).call(t,n(3))},function(e,t,n){"use strict";var r=n(5),o=n(6),i=n(8);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"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")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=n(12),o=n(13);if("undefined"==typeof r)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new r.Component).updater;e.exports=o(r.Component,r.isValidElement,i)},function(t,n){t.exports=e},function(e,t,n){(function(t){"use strict";function r(e){return e}function o(e,n,o){function p(e,n,r){for(var o in n)n.hasOwnProperty(o)&&"production"!==t.env.NODE_ENV&&c("function"==typeof n[o],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[r],o)}function d(e,t){var n=b.hasOwnProperty(t)?b[t]:null;k.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function f(e,r){if(r){s("function"!=typeof r,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!n(r),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var o=e.prototype,i=o.__reactAutoBindPairs;r.hasOwnProperty(l)&&w.mixins(e,r.mixins);for(var a in r)if(r.hasOwnProperty(a)&&a!==l){var u=r[a],p=o.hasOwnProperty(a);if(d(p,a),w.hasOwnProperty(a))w[a](e,u);else{var f=b.hasOwnProperty(a),h="function"==typeof u,m=h&&!f&&!p&&r.autobind!==!1;if(m)i.push(a,u),o[a]=u;else if(p){var E=b[a];s(f&&("DEFINE_MANY_MERGED"===E||"DEFINE_MANY"===E),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",E,a),"DEFINE_MANY_MERGED"===E?o[a]=y(o[a],u):"DEFINE_MANY"===E&&(o[a]=v(o[a],u))}else o[a]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&r.displayName&&(o[a].displayName=r.displayName+"_"+a)}}}else if("production"!==t.env.NODE_ENV){var g=typeof r,D="object"===g&&null!==r;"production"!==t.env.NODE_ENV&&c(D,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===r?null:g)}}function h(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in w;s(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function m(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function y(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return m(o,n),m(o,r),o}}function v(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function E(e,n){var r=n.bind(e);if("production"!==t.env.NODE_ENV){r.__reactBoundContext=e,r.__reactBoundMethod=n,r.__reactBoundArguments=null;var o=e.constructor.displayName,i=r.bind;r.bind=function(a){for(var s=arguments.length,u=Array(s>1?s-1:0),l=1;l<s;l++)u[l-1]=arguments[l];if(a!==e&&null!==a)"production"!==t.env.NODE_ENV&&c(!1,"bind(): React component methods may only be bound to the component instance. See %s",o);else if(!u.length)return"production"!==t.env.NODE_ENV&&c(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",o),r;var p=i.apply(r,arguments);return p.__reactBoundContext=e,p.__reactBoundMethod=n,p.__reactBoundArguments=u,p}}return r}function g(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=E(e,o)}}function D(e){var n=r(function(e,r,i){"production"!==t.env.NODE_ENV&&c(this instanceof n,"Something is calling a React component directly. Use a factory or JSX instead. See: https://fb.me/react-legacyfactory"),this.__reactAutoBindPairs.length&&g(this),this.props=e,this.context=r,this.refs=a,this.updater=i||o,this.state=null;var u=this.getInitialState?this.getInitialState():null;"production"!==t.env.NODE_ENV&&void 0===u&&this.getInitialState._isMockFunction&&(u=null),s("object"==typeof u&&!Array.isArray(u),"%s.getInitialState(): must return an object or null",n.displayName||"ReactCompositeComponent"),this.state=u});n.prototype=new _,n.prototype.constructor=n,n.prototype.__reactAutoBindPairs=[],O.forEach(f.bind(null,n)),f(n,N),f(n,e),f(n,C),n.getDefaultProps&&(n.defaultProps=n.getDefaultProps()),"production"!==t.env.NODE_ENV&&(n.getDefaultProps&&(n.getDefaultProps.isReactClassApproved={}),n.prototype.getInitialState&&(n.prototype.getInitialState.isReactClassApproved={})),s(n.prototype.render,"createClass(...): Class specification must implement a `render` method."),"production"!==t.env.NODE_ENV&&(c(!n.prototype.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",e.displayName||"A component"),c(!n.prototype.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",e.displayName||"A component"));for(var i in b)n.prototype[i]||(n.prototype[i]=null);return n}var O=[],b={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},w={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)f(e,t[n])},childContextTypes:function(e,n){"production"!==t.env.NODE_ENV&&p(e,n,"childContext"),e.childContextTypes=i({},e.childContextTypes,n)},contextTypes:function(e,n){"production"!==t.env.NODE_ENV&&p(e,n,"context"),e.contextTypes=i({},e.contextTypes,n)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=y(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,n){"production"!==t.env.NODE_ENV&&p(e,n,"prop"),e.propTypes=i({},e.propTypes,n)},statics:function(e,t){h(e,t)},autobind:function(){}},N={componentDidMount:function(){this.__isMounted=!0}},C={componentWillUnmount:function(){this.__isMounted=!1}},k={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return"production"!==t.env.NODE_ENV&&(c(this.__didWarnIsMounted,"%s: isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.",this.constructor&&this.constructor.displayName||this.name||"Component"),this.__didWarnIsMounted=!0),!!this.__isMounted}},_=function(){};return i(_.prototype,e.prototype,k),D}var i=n(14),a=n(15),s=n(6);if("production"!==t.env.NODE_ENV)var c=n(7);var u,l="mixins";u="production"!==t.env.NODE_ENV?{prop:"prop",context:"context",childContext:"child context"}:{},e.exports=o}).call(t,n(3))},function(e,t){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(i){return!1}}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=r()?Object.assign:function(e,t){for(var r,s,c=n(e),u=1;u<arguments.length;u++){r=Object(arguments[u]);for(var l in r)i.call(r,l)&&(c[l]=r[l]);if(o){s=o(r);for(var p=0;p<s.length;p++)a.call(r,s[p])&&(c[s[p]]=r[s[p]])}}return c}},function(e,t,n){(function(t){"use strict";var n={};"production"!==t.env.NODE_ENV&&Object.freeze(n),e.exports=n}).call(t,n(3))},function(e,n){e.exports=t},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(18),a=n(19),s=n(20),c=n(21),u=o({viewComponents:{days:i,months:a,years:s,time:c},render:function(){return r.createElement(this.viewComponents[this.props.view],this.props.viewProps)}});e.exports=u},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(16),a=o({render:function(){var e,t=this.renderFooter(),n=this.props.viewDate,o=n.localeData();return e=[r.createElement("thead",{key:"th"},[r.createElement("tr",{key:"h"},[r.createElement("th",{key:"p",className:"rdtPrev",onClick:this.props.subtractTime(1,"months")},r.createElement("span",{},"‹")),r.createElement("th",{key:"s",className:"rdtSwitch",onClick:this.props.showView("months"),colSpan:5,"data-value":this.props.viewDate.month()},o.months(n)+" "+n.year()),r.createElement("th",{key:"n",className:"rdtNext",onClick:this.props.addTime(1,"months")},r.createElement("span",{},"›"))]),r.createElement("tr",{key:"d"},this.getDaysOfWeek(o).map(function(e,t){return r.createElement("th",{key:e+t,className:"dow"},e)}))]),r.createElement("tbody",{key:"tb"},this.renderDays())],t&&e.push(t),r.createElement("div",{className:"rdtDays"},r.createElement("table",{},e))},getDaysOfWeek:function(e){var t=e._weekdaysMin,n=e.firstDayOfWeek(),r=[],o=0;return t.forEach(function(e){r[(7+o++-n)%7]=e}),r},renderDays:function(){var e,t,n,o,a=this.props.viewDate,s=this.props.selectedDate&&this.props.selectedDate.clone(),c=a.clone().subtract(1,"months"),u=a.year(),l=a.month(),p=[],d=[],f=this.props.renderDay||this.renderDay,h=this.props.isValidDate||this.alwaysValidDate;c.date(c.daysInMonth()).startOf("week");for(var m=c.clone().add(42,"d");c.isBefore(m);)e="rdtDay",o=c.clone(),c.year()===u&&c.month()<l||c.year()<u?e+=" rdtOld":(c.year()===u&&c.month()>l||c.year()>u)&&(e+=" rdtNew"),s&&c.isSame(s,"day")&&(e+=" rdtActive"),c.isSame(i(),"day")&&(e+=" rdtToday"),t=!h(o,s),t&&(e+=" rdtDisabled"),n={key:c.format("M_D"),"data-value":c.date(),className:e},t||(n.onClick=this.updateSelectedDate),d.push(f(n,o,s)),7===d.length&&(p.push(r.createElement("tr",{key:c.format("M_D")},d)),d=[]),c.add(1,"d");return p},updateSelectedDate:function(e){this.props.updateSelectedDate(e,!0)},renderDay:function(e,t){return r.createElement("td",e,t.date())},renderFooter:function(){if(!this.props.timeFormat)return"";var e=this.props.selectedDate||this.props.viewDate;return r.createElement("tfoot",{key:"tf"},r.createElement("tr",{},r.createElement("td",{onClick:this.props.showView("time"),colSpan:7,className:"rdtTimeToggle"},e.format(this.props.timeFormat))))},alwaysValidDate:function(){ | ||
return 1}});e.exports=a},function(e,t,n){"use strict";function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}var o=n(12),i=n(11),a=i({render:function(){return o.createElement("div",{className:"rdtMonths"},[o.createElement("table",{key:"a"},o.createElement("thead",{},o.createElement("tr",{},[o.createElement("th",{key:"prev",className:"rdtPrev",onClick:this.props.subtractTime(1,"years")},o.createElement("span",{},"‹")),o.createElement("th",{key:"year",className:"rdtSwitch",onClick:this.props.showView("years"),colSpan:2,"data-value":this.props.viewDate.year()},this.props.viewDate.year()),o.createElement("th",{key:"next",className:"rdtNext",onClick:this.props.addTime(1,"years")},o.createElement("span",{},"›"))]))),o.createElement("table",{key:"months"},o.createElement("tbody",{key:"b"},this.renderMonths()))])},renderMonths:function(){for(var e,t,n,r,i,a,s,c=this.props.selectedDate,u=this.props.viewDate.month(),l=this.props.viewDate.year(),p=[],d=0,f=[],h=this.props.renderMonth||this.renderMonth,m=this.props.isValidDate||this.alwaysValidDate,y=1;d<12;)e="rdtMonth",n=this.props.viewDate.clone().set({year:l,month:d,date:y}),i=n.endOf("month").format("D"),a=Array.from({length:i},function(e,t){return t+1}),s=a.find(function(e){var t=n.clone().set("date",e);return m(t)}),r=void 0===s,r&&(e+=" rdtDisabled"),c&&d===c.month()&&l===c.year()&&(e+=" rdtActive"),t={key:d,"data-value":d,className:e},r||(t.onClick="months"===this.props.updateOn?this.updateSelectedMonth:this.props.setDate("month")),f.push(h(t,d,l,c&&c.clone())),4===f.length&&(p.push(o.createElement("tr",{key:u+"_"+p.length},f)),f=[]),d++;return p},updateSelectedMonth:function(e){this.props.updateSelectedDate(e)},renderMonth:function(e,t){var n=this.props.viewDate,i=n.localeData().monthsShort(n.month(t)),a=3,s=i.substring(0,a);return o.createElement("td",e,r(s))},alwaysValidDate:function(){return 1}});e.exports=a},function(e,t,n){"use strict";var r=n(12),o=n(11),i=o({render:function(){var e=10*parseInt(this.props.viewDate.year()/10,10);return r.createElement("div",{className:"rdtYears"},[r.createElement("table",{key:"a"},r.createElement("thead",{},r.createElement("tr",{},[r.createElement("th",{key:"prev",className:"rdtPrev",onClick:this.props.subtractTime(10,"years")},r.createElement("span",{},"‹")),r.createElement("th",{key:"year",className:"rdtSwitch",onClick:this.props.showView("years"),colSpan:2},e+"-"+(e+9)),r.createElement("th",{key:"next",className:"rdtNext",onClick:this.props.addTime(10,"years")},r.createElement("span",{},"›"))]))),r.createElement("table",{key:"years"},r.createElement("tbody",{},this.renderYears(e)))])},renderYears:function(e){var t,n,o,i,a,s,c,u=[],l=-1,p=[],d=this.props.renderYear||this.renderYear,f=this.props.selectedDate,h=this.props.isValidDate||this.alwaysValidDate,m=0,y=1;for(e--;l<11;)t="rdtYear",o=this.props.viewDate.clone().set({year:e,month:m,date:y}),a=o.endOf("year").format("DDD"),s=Array.from({length:a},function(e,t){return t+1}),c=s.find(function(e){var t=o.clone().dayOfYear(e);return h(t)}),i=void 0===c,i&&(t+=" rdtDisabled"),f&&f.year()===e&&(t+=" rdtActive"),n={key:e,"data-value":e,className:t},i||(n.onClick="years"===this.props.updateOn?this.updateSelectedYear:this.props.setDate("year")),u.push(d(n,e,f&&f.clone())),4===u.length&&(p.push(r.createElement("tr",{key:l},u)),u=[]),e++,l++;return p},updateSelectedYear:function(e){this.props.updateSelectedDate(e)},renderYear:function(e,t){return r.createElement("td",e,t)},alwaysValidDate:function(){return 1}});e.exports=i},function(e,t,n){"use strict";var r=n(12),o=n(11),i=n(1),a=o({getInitialState:function(){return this.calculateState(this.props)},calculateState:function(e){var t=e.selectedDate||e.viewDate,n=e.timeFormat,r=[];n.toLowerCase().indexOf("h")!==-1&&(r.push("hours"),n.indexOf("m")!==-1&&(r.push("minutes"),n.indexOf("s")!==-1&&r.push("seconds")));var o=t.format("H"),i=!1;return null!==this.state&&this.props.timeFormat.toLowerCase().indexOf(" a")!==-1&&(i=this.props.timeFormat.indexOf(" A")!==-1?o>=12?"PM":"AM":o>=12?"pm":"am"),{hours:o,minutes:t.format("mm"),seconds:t.format("ss"),milliseconds:t.format("SSS"),daypart:i,counters:r}},renderCounter:function(e){if("daypart"!==e){var t=this.state[e];return"hours"===e&&this.props.timeFormat.toLowerCase().indexOf(" a")!==-1&&(t=(t-1)%12+1,0===t&&(t=12)),r.createElement("div",{key:e,className:"rdtCounter"},[r.createElement("span",{key:"up",className:"rdtBtn",onMouseDown:this.onStartClicking("increase",e),onContextMenu:this.disableContextMenu},"▲"),r.createElement("div",{key:"c",className:"rdtCount"},t),r.createElement("span",{key:"do",className:"rdtBtn",onMouseDown:this.onStartClicking("decrease",e),onContextMenu:this.disableContextMenu},"▼")])}return""},renderDayPart:function(){return r.createElement("div",{key:"dayPart",className:"rdtCounter"},[r.createElement("span",{key:"up",className:"rdtBtn",onMouseDown:this.onStartClicking("toggleDayPart","hours"),onContextMenu:this.disableContextMenu},"▲"),r.createElement("div",{key:this.state.daypart,className:"rdtCount"},this.state.daypart),r.createElement("span",{key:"do",className:"rdtBtn",onMouseDown:this.onStartClicking("toggleDayPart","hours"),onContextMenu:this.disableContextMenu},"▼")])},render:function(){var e=this,t=[];return this.state.counters.forEach(function(n){t.length&&t.push(r.createElement("div",{key:"sep"+t.length,className:"rdtCounterSeparator"},":")),t.push(e.renderCounter(n))}),this.state.daypart!==!1&&t.push(e.renderDayPart()),3===this.state.counters.length&&this.props.timeFormat.indexOf("S")!==-1&&(t.push(r.createElement("div",{className:"rdtCounterSeparator",key:"sep5"},":")),t.push(r.createElement("div",{className:"rdtCounter rdtMilli",key:"m"},r.createElement("input",{value:this.state.milliseconds,type:"text",onChange:this.updateMilli})))),r.createElement("div",{className:"rdtTime"},r.createElement("table",{},[this.renderHeader(),r.createElement("tbody",{key:"b"},r.createElement("tr",{},r.createElement("td",{},r.createElement("div",{className:"rdtCounters"},t))))]))},componentWillMount:function(){var e=this;e.timeConstraints={hours:{min:0,max:23,step:1},minutes:{min:0,max:59,step:1},seconds:{min:0,max:59,step:1},milliseconds:{min:0,max:999,step:1}},["hours","minutes","seconds","milliseconds"].forEach(function(t){i(e.timeConstraints[t],e.props.timeConstraints[t])}),this.setState(this.calculateState(this.props))},componentWillReceiveProps:function(e){this.setState(this.calculateState(e))},updateMilli:function(e){var t=parseInt(e.target.value,10);t===e.target.value&&t>=0&&t<1e3&&(this.props.setTime("milliseconds",t),this.setState({milliseconds:t}))},renderHeader:function(){if(!this.props.dateFormat)return null;var e=this.props.selectedDate||this.props.viewDate;return r.createElement("thead",{key:"h"},r.createElement("tr",{},r.createElement("th",{className:"rdtSwitch",colSpan:4,onClick:this.props.showView("days")},e.format(this.props.dateFormat))))},onStartClicking:function(e,t){var n=this;return function(){var r={};r[t]=n[e](t),n.setState(r),n.timer=setTimeout(function(){n.increaseTimer=setInterval(function(){r[t]=n[e](t),n.setState(r)},70)},500),n.mouseUpListener=function(){clearTimeout(n.timer),clearInterval(n.increaseTimer),n.props.setTime(t,n.state[t]),document.body.removeEventListener("mouseup",n.mouseUpListener),document.body.removeEventListener("touchend",n.mouseUpListener)},document.body.addEventListener("mouseup",n.mouseUpListener),document.body.addEventListener("touchend",n.mouseUpListener)}},disableContextMenu:function(e){return e.preventDefault(),!1},padValues:{hours:1,minutes:2,seconds:2,milliseconds:3},toggleDayPart:function(e){var t=parseInt(this.state[e],10)+12;return t>this.timeConstraints[e].max&&(t=this.timeConstraints[e].min+(t-(this.timeConstraints[e].max+1))),this.pad(e,t)},increase:function(e){var t=parseInt(this.state[e],10)+this.timeConstraints[e].step;return t>this.timeConstraints[e].max&&(t=this.timeConstraints[e].min+(t-(this.timeConstraints[e].max+1))),this.pad(e,t)},decrease:function(e){var t=parseInt(this.state[e],10)-this.timeConstraints[e].step;return t<this.timeConstraints[e].min&&(t=this.timeConstraints[e].max+1-(this.timeConstraints[e].min-t)),this.pad(e,t)},pad:function(e,t){for(var n=t+"";n.length<this.padValues[e];)n="0"+n;return n}});e.exports=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){var n,r;return r=n=function(n){function r(){var e,t,a;o(this,r);for(var s=arguments.length,c=Array(s),u=0;u<s;u++)c[u]=arguments[u];return e=t=i(this,n.call.apply(n,[this].concat(c))),t.__outsideClickHandler=null,t.enableOnClickOutside=function(){var e=t.__outsideClickHandler;if(e&&"undefined"!=typeof document){var n=t.props.eventTypes;n.forEach||(n=[n]),n.forEach(function(n){var r=null,o=h.indexOf(n)!==-1;o&&(r={passive:!t.props.preventDefault}),document.addEventListener(n,e,r)})}},t.disableOnClickOutside=function(){var e=t.__outsideClickHandler;if(e&&"undefined"!=typeof document){var n=t.props.eventTypes;n.forEach||(n=[n]),n.forEach(function(t){return document.removeEventListener(t,e)})}},t.getRef=function(e){return t.instanceRef=e},a=e,i(t,a)}return a(r,n),r.prototype.getInstance=function(){if(!e.prototype.isReactComponent)return this;var t=this.instanceRef;return t.getInstance?t.getInstance():t},r.prototype.componentDidMount=function(){if("undefined"!=typeof document&&document.createElement){var e=this.getInstance();if(t&&"function"==typeof t.handleClickOutside){if(this.__clickOutsideHandlerProp=t.handleClickOutside(e),"function"!=typeof this.__clickOutsideHandlerProp)throw new Error("WrappedComponent lacks a function for processing outside click events specified by the handleClickOutside config option.")}else if("function"==typeof e.handleClickOutside)c.Component.prototype.isPrototypeOf(e)?this.__clickOutsideHandlerProp=e.handleClickOutside.bind(e):this.__clickOutsideHandlerProp=e.handleClickOutside;else{if("function"!=typeof e.props.handleClickOutside)throw new Error("WrappedComponent lacks a handleClickOutside(event) function for processing outside click events.");this.__clickOutsideHandlerProp=e.props.handleClickOutside}null!==(0,u.findDOMNode)(e)&&this.addOutsideClickHandler()}},r.prototype.componentWillReceiveProps=function(e){this.props.disableOnClickOutside&&!e.disableOnClickOutside?this.enableOnClickOutside():!this.props.disableOnClickOutside&&e.disableOnClickOutside&&this.disableOnClickOutside()},r.prototype.componentDidUpdate=function(){var e=(0,u.findDOMNode)(this.getInstance());return null===e&&this.__outsideClickHandler?void this.removeOutsideClickHandler():null===e||this.__outsideClickHandler?void 0:void this.addOutsideClickHandler()},r.prototype.componentWillUnmount=function(){this.removeOutsideClickHandler()},r.prototype.addOutsideClickHandler=function(){var e=this.__outsideClickHandler=(0,p["default"])((0,u.findDOMNode)(this.getInstance()),this.__clickOutsideHandlerProp,this.props.outsideClickIgnoreClass,this.props.excludeScrollbar,this.props.preventDefault,this.props.stopPropagation),t=d.length;d.push(this),f[t]=e,this.props.disableOnClickOutside||this.enableOnClickOutside()},r.prototype.removeOutsideClickHandler=function(){this.disableOnClickOutside(),this.__outsideClickHandler=!1;var e=d.indexOf(this);e>-1&&(f[e]&&f.splice(e,1),d.splice(e,1))},r.prototype.render=function(){var t=this,n=Object.keys(this.props).filter(function(e){return"excludeScrollbar"!==e}).reduce(function(e,n){return e[n]=t.props[n],e},{});return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,(0,c.createElement)(e,n)},r}(c.Component),n.displayName="OnClickOutside("+(e.displayName||e.name||"Component")+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:m,preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r}t.__esModule=!0,t.IGNORE_CLASS_NAME=void 0,t["default"]=s;var c=n(12),u=n(23),l=n(24),p=r(l),d=[],f=[],h=["touchstart","touchmove"],m=t.IGNORE_CLASS_NAME="ignore-react-onclickoutside"},function(e,t){e.exports=n},function(e,t){"use strict";function n(e,t,n){return e===t||(e.correspondingElement?e.correspondingElement.classList.contains(n):e.classList.contains(n))}function r(e,t,r){if(e===t)return!0;for(;e.parentNode;){if(n(e,t,r))return!0;e=e.parentNode}return e}function o(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY}function i(e,t,n,i,a,s){return function(c){a&&c.preventDefault(),s&&c.stopPropagation();var u=c.target;i&&o(c)||r(u,e,n)!==document||t(c)}}t.__esModule=!0,t["default"]=i}])}); | ||
//# sourceMappingURL=react-datetime.min.js.map |
{ | ||
"name": "react-datetime", | ||
"version": "2.15.0", | ||
"version": "2.16.0", | ||
"description": "A lightweight but complete datetime picker React.js component", | ||
@@ -44,2 +44,3 @@ "homepage": "https://github.com/YouCanBookMe/react-datetime", | ||
"moment": ">=2.16.0", | ||
"moment-timezone": "^0.5.13", | ||
"react": ">=0.13", | ||
@@ -71,2 +72,3 @@ "react-dom": ">=0.13" | ||
"moment": ">=2.16.0", | ||
"moment-timezone": "^0.5.13", | ||
"pre-commit": "^1.1.3", | ||
@@ -73,0 +75,0 @@ "react": "^15.5.0", |
@@ -24,3 +24,3 @@ # react-datetime | ||
[React.js](http://facebook.github.io/react/) and [Moment.js](http://momentjs.com/) are peer dependencies for react-datetime. These dependencies are not installed along with react-datetime automatically, but your project needs to have them installed in order to make the datepicker work. You can then use the datepicker like in the example below. | ||
[React.js](http://facebook.github.io/react/) and [Moment.js](http://momentjs.com/) are peer dependencies for react-datetime (as well as [Moment.js timezones](https://momentjs.com/timezone/) if you want to use the `displayTimeZone` prop). These dependencies are not installed along with react-datetime automatically, but your project needs to have them installed in order to make the datepicker work. You can then use the datepicker like in the example below. | ||
@@ -54,2 +54,3 @@ | ||
| **utc** | `boolean` | `false` | When true, input time values will be interpreted as UTC (Zulu time) by Moment.js. Otherwise they will default to the user's local timezone. | ||
| **displayTimeZone** | `string` | `null` | **Needs [moment's timezone](https://momentjs.com/timezone/) available in your project.** When specified, input time values will be displayed in the given time zone. Otherwise they will default to the user's local timezone (unless `utc` specified). | ||
| **onChange** | `function` | empty function | Callback trigger when the date changes. The callback receives the selected `moment` object as only parameter, if the date in the input is valid. If the date in the input is not valid, the callback receives the value of the input (a string). | | ||
@@ -73,3 +74,3 @@ | **onFocus** | `function` | empty function | Callback trigger for when the user opens the datepicker. The callback receives an event of type SyntheticEvent. | | ||
| **timeConstraints** | `object` | `null` | Add some constraints to the timepicker. It accepts an `object` with the format `{ hours: { min: 9, max: 15, step: 2 }}`, this example means the hours can't be lower than `9` and higher than `15`, and it will change adding or subtracting `2` hours everytime the buttons are clicked. The constraints can be added to the `hours`, `minutes`, `seconds` and `milliseconds`. | ||
| **disableOnClickOutside** | `boolean` | `false` | When `true`, keep the datepicker open when click event is triggered outside of component. When `false`, close it. | ||
| **disableCloseOnClickOutside** | `boolean` | `false` | When `true`, keep the datepicker open when click event is triggered outside of component. When `false`, close it. | ||
@@ -76,0 +77,0 @@ ## i18n |
@@ -5,7 +5,6 @@ 'use strict'; | ||
createClass = require('create-react-class'), | ||
moment = require('moment'), | ||
onClickOutside = require('react-onclickoutside').default | ||
moment = require('moment') | ||
; | ||
var DateTimePickerDays = onClickOutside( createClass({ | ||
var DateTimePickerDays = createClass({ | ||
render: function() { | ||
@@ -138,9 +137,5 @@ var footer = this.renderFooter(), | ||
return 1; | ||
}, | ||
handleClickOutside: function() { | ||
this.props.handleClickOutside(); | ||
} | ||
})); | ||
}); | ||
module.exports = DateTimePickerDays; |
'use strict'; | ||
var React = require('react'), | ||
createClass = require('create-react-class'), | ||
onClickOutside = require('react-onclickoutside').default | ||
; | ||
createClass = require('create-react-class') | ||
; | ||
var DateTimePickerMonths = onClickOutside( createClass({ | ||
var DateTimePickerMonths = createClass({ | ||
render: function() { | ||
@@ -97,8 +96,4 @@ return React.createElement('div', { className: 'rdtMonths' }, [ | ||
}, | ||
}); | ||
handleClickOutside: function() { | ||
this.props.handleClickOutside(); | ||
} | ||
})); | ||
function capitalize( str ) { | ||
@@ -105,0 +100,0 @@ return str.charAt( 0 ).toUpperCase() + str.slice( 1 ); |
@@ -5,7 +5,6 @@ 'use strict'; | ||
createClass = require('create-react-class'), | ||
assign = require('object-assign'), | ||
onClickOutside = require('react-onclickoutside').default | ||
assign = require('object-assign') | ||
; | ||
var DateTimePickerTime = onClickOutside( createClass({ | ||
var DateTimePickerTime = createClass({ | ||
getInitialState: function() { | ||
@@ -32,3 +31,3 @@ return this.calculateState( this.props ); | ||
var hours = date.format( 'H' ); | ||
var daypart = false; | ||
@@ -233,8 +232,4 @@ if ( this.state !== null && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) { | ||
}, | ||
}); | ||
handleClickOutside: function() { | ||
this.props.handleClickOutside(); | ||
} | ||
})); | ||
module.exports = DateTimePickerTime; |
'use strict'; | ||
var React = require('react'), | ||
createClass = require('create-react-class'), | ||
onClickOutside = require('react-onclickoutside').default | ||
; | ||
createClass = require('create-react-class') | ||
; | ||
var DateTimePickerYears = onClickOutside( createClass({ | ||
var DateTimePickerYears = createClass({ | ||
render: function() { | ||
@@ -99,8 +98,4 @@ var year = parseInt( this.props.viewDate.year() / 10, 10 ) * 10; | ||
}, | ||
}); | ||
handleClickOutside: function() { | ||
this.props.handleClickOutside(); | ||
} | ||
})); | ||
module.exports = DateTimePickerYears; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
543181
4704
220
8
33