react-datetime
Advanced tools
Comparing version 2.8.9 to 2.8.10
Changelog | ||
========= | ||
## 2.8.10 | ||
* Increase click area of arrows for changing day/month/year | ||
* Update code according to React 15.5.0 | ||
* Remove usage of React.createClass | ||
* Use separate module for PropTypes | ||
## 2.8.9 | ||
@@ -4,0 +10,0 @@ * Fixes issue where incorrect current month is shown |
'use strict'; | ||
var assign = require('object-assign'), | ||
PropTypes = require('prop-types'), | ||
createClass = require('create-react-class'), | ||
moment = require('moment'), | ||
@@ -9,4 +11,4 @@ React = require('react'), | ||
var TYPES = React.PropTypes; | ||
var Datetime = React.createClass({ | ||
var TYPES = PropTypes; | ||
var Datetime = createClass({ | ||
propTypes: { | ||
@@ -13,0 +15,0 @@ // value: TYPES.object | TYPES.string, |
/* | ||
react-datetime v2.8.9 | ||
react-datetime v2.8.10 | ||
https://github.com/YouCanBookMe/react-datetime | ||
MIT: https://github.com/YouCanBookMe/react-datetime/raw/master/LICENSE | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("moment"),require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["moment","React","ReactDOM"],e):"object"==typeof exports?exports.Datetime=e(require("moment"),require("React"),require("ReactDOM")):t.Datetime=e(t.moment,t.React,t.ReactDOM)}(this,function(t,e,s){return function(t){function e(n){if(s[n])return s[n].exports;var i=s[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var s={};return e.m=t,e.c=s,e.p="",e(0)}([function(t,e,s){"use strict";var n=s(1),i=s(2),a=s(3),r=s(4),o=a.PropTypes,c=a.createClass({propTypes:{onFocus:o.func,onBlur:o.func,onChange:o.func,locale:o.string,utc:o.bool,input:o.bool,inputProps:o.object,timeConstraints:o.object,viewMode:o.oneOf(["years","months","days","time"]),isValidDate:o.func,open:o.bool,strictParsing:o.bool,closeOnSelect:o.bool,closeOnTab:o.bool},getDefaultProps:function(){var t=function(){};return{className:"",defaultValue:"",inputProps:{},input:!0,onFocus:t,onBlur:t,onChange:t,timeFormat:!0,timeConstraints:{},dateFormat:!0,strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,utc:!1}},getInitialState:function(){var t=this.getStateFromProps(this.props);return void 0===t.open&&(t.open=!this.props.input),t.currentView=this.props.dateFormat?this.props.viewMode||t.updateOn||"days":"time",t},getStateFromProps:function(t){var e,s,n,i,a=this.getFormats(t),r=t.value||t.defaultValue;return r&&"string"==typeof r?e=this.localMoment(r,a.datetime):r&&(e=this.localMoment(r)),e&&!e.isValid()&&(e=null),s=e?e.clone().startOf("month"):this.localMoment().startOf("month"),n=this.getUpdateOn(a),i=e?e.format(a.datetime):r.isValid&&!r.isValid()?"":r||"",{updateOn:n,inputFormat:a.datetime,viewDate:s,selectedDate:e,inputValue:i,open:t.open}},getUpdateOn:function(t){return t.date.match(/[lLD]/)?"days":t.date.indexOf("M")!==-1?"months":t.date.indexOf("Y")!==-1?"years":"days"},getFormats:function(t){var e={date:t.dateFormat||"",time:t.timeFormat||""},s=this.localMoment(t.date,null,t).localeData();return e.date===!0?e.date=s.longDateFormat("L"):"days"!==this.getUpdateOn(e)&&(e.time=""),e.time===!0&&(e.time=s.longDateFormat("LT")),e.datetime=e.date&&e.time?e.date+" "+e.time:e.date||e.time,e},componentWillReceiveProps:function(t){var e=this.getFormats(t),s={};if(t.value===this.props.value&&e.datetime===this.getFormats(this.props).datetime||(s=this.getStateFromProps(t)),void 0===s.open&&(this.props.closeOnSelect&&"time"!==this.state.currentView?s.open=!1:s.open=this.state.open),t.viewMode!==this.props.viewMode&&(s.currentView=t.viewMode),t.locale!==this.props.locale){if(this.state.viewDate){var n=this.state.viewDate.clone().locale(t.locale);s.viewDate=n}if(this.state.selectedDate){var i=this.state.selectedDate.clone().locale(t.locale);s.selectedDate=i,s.inputValue=i.format(e.datetime)}}t.utc!==this.props.utc&&(t.utc?(this.state.viewDate&&(s.viewDate=this.state.viewDate.clone().utc()),this.state.selectedDate&&(s.selectedDate=this.state.selectedDate.clone().utc(),s.inputValue=s.selectedDate.format(e.datetime))):(this.state.viewDate&&(s.viewDate=this.state.viewDate.clone().local()),this.state.selectedDate&&(s.selectedDate=this.state.selectedDate.clone().local(),s.inputValue=s.selectedDate.format(e.datetime)))),this.setState(s)},onInputChange:function(t){var e=null===t.target?t:t.target.value,s=this.localMoment(e,this.state.inputFormat),n={inputValue:e};return s.isValid()&&!this.props.value?(n.selectedDate=s,n.viewDate=s.clone().startOf("month")):n.selectedDate=null,this.setState(n,function(){return this.props.onChange(s.isValid()?s:this.state.inputValue)})},onInputKey:function(t){9===t.which&&this.props.closeOnTab&&this.closeCalendar()},showView:function(t){var e=this;return function(){e.setState({currentView:t})}},setDate:function(t){var e=this,s={month:"days",year:"months"};return function(n){e.setState({viewDate:e.state.viewDate.clone()[t](parseInt(n.target.getAttribute("data-value"),10)).startOf(t),currentView:s[t]})}},addTime:function(t,e,s){return this.updateTime("add",t,e,s)},subtractTime:function(t,e,s){return this.updateTime("subtract",t,e,s)},updateTime:function(t,e,s,n){var i=this;return function(){var a={},r=n?"selectedDate":"viewDate";a[r]=i.state[r].clone()[t](e,s),i.setState(a)}},allowedSetTime:["hours","minutes","seconds","milliseconds"],setTime:function(t,e){var s,n=this.allowedSetTime.indexOf(t)+1,i=this.state,a=(i.selectedDate||i.viewDate).clone();for(a[t](e);n<this.allowedSetTime.length;n++)s=this.allowedSetTime[n],a[s](a[s]());this.props.value||this.setState({selectedDate:a,inputValue:a.format(i.inputFormat)}),this.props.onChange(a)},updateSelectedDate:function(t,e){var s,n=t.target,i=0,a=this.state.viewDate,r=this.state.selectedDate||a;if(n.className.indexOf("rdtDay")!==-1?(n.className.indexOf("rdtNew")!==-1?i=1:n.className.indexOf("rdtOld")!==-1&&(i=-1),s=a.clone().month(a.month()+i).date(parseInt(n.getAttribute("data-value"),10))):n.className.indexOf("rdtMonth")!==-1?s=a.clone().month(parseInt(n.getAttribute("data-value"),10)).date(r.date()):n.className.indexOf("rdtYear")!==-1&&(s=a.clone().month(r.month()).date(r.date()).year(parseInt(n.getAttribute("data-value"),10))),s.hours(r.hours()).minutes(r.minutes()).seconds(r.seconds()).milliseconds(r.milliseconds()),this.props.value)this.props.closeOnSelect&&e&&this.closeCalendar();else{var o=!(this.props.closeOnSelect&&e);o||this.props.onBlur(s),this.setState({selectedDate:s,viewDate:s.clone().startOf("month"),inputValue:s.format(this.state.inputFormat),open:o})}this.props.onChange(s)},openCalendar:function(){this.state.open||this.setState({open:!0},function(){this.props.onFocus()})},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.setState({open:!1},function(){this.props.onBlur(this.state.selectedDate||this.state.inputValue)})},localMoment:function(t,e,s){s=s||this.props;var n=s.utc?i.utc:i,a=n(t,e,s.strictParsing);return s.locale&&a.locale(s.locale),a},componentProps:{fromProps:["value","isValidDate","renderDay","renderMonth","renderYear","timeConstraints"],fromState:["viewDate","selectedDate","updateOn"],fromThis:["setDate","setTime","showView","addTime","subtractTime","updateSelectedDate","localMoment","handleClickOutside"]},getComponentProps:function(){var t=this,e=this.getFormats(this.props),s={dateFormat:e.date,timeFormat:e.time};return this.componentProps.fromProps.forEach(function(e){s[e]=t.props[e]}),this.componentProps.fromState.forEach(function(e){s[e]=t.state[e]}),this.componentProps.fromThis.forEach(function(e){s[e]=t[e]}),s},render:function(){var t=a.DOM,e="rdt"+(this.props.className?Array.isArray(this.props.className)?" "+this.props.className.join(" "):" "+this.props.className:""),s=[];return this.props.input?s=[t.input(n({key:"i",type:"text",className:"form-control",onFocus:this.openCalendar,onChange:this.onInputChange,onKeyDown:this.onInputKey,value:this.state.inputValue},this.props.inputProps))]:e+=" rdtStatic",this.state.open&&(e+=" rdtOpen"),t.div({className:e},s.concat(t.div({key:"dt",className:"rdtPicker"},a.createElement(r,{view:this.state.currentView,viewProps:this.getComponentProps(),onClickOutside:this.handleClickOutside}))))}});c.moment=i,t.exports=c},function(t,e){"use strict";function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function n(t){var e=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(t))),e.filter(function(e){return i.call(t,e)})}var i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(t,e){for(var i,a,r=s(t),o=1;o<arguments.length;o++){i=arguments[o],a=n(Object(i));for(var c=0;c<a.length;c++)r[a[c]]=i[a[c]]}return r}},function(e,s){e.exports=t},function(t,s){t.exports=e},function(t,e,s){var n=s(3),i=s(5),a=s(8),r=s(9),o=s(10),c=n.createClass({viewComponents:{days:i,months:a,years:r,time:o},render:function(){return n.createElement(this.viewComponents[this.props.view],this.props.viewProps)}});t.exports=c},function(t,e,s){"use strict";var n=s(3),i=s(2),a=s(6),r=n.DOM,o=a(n.createClass({render:function(){var t,e=this.renderFooter(),s=this.props.viewDate,n=s.localeData();return t=[r.thead({key:"th"},[r.tr({key:"h"},[r.th({key:"p",className:"rdtPrev"},r.span({onClick:this.props.subtractTime(1,"months")},"‹")),r.th({key:"s",className:"rdtSwitch",onClick:this.props.showView("months"),colSpan:5,"data-value":this.props.viewDate.month()},n.months(s)+" "+s.year()),r.th({key:"n",className:"rdtNext"},r.span({onClick:this.props.addTime(1,"months")},"›"))]),r.tr({key:"d"},this.getDaysOfWeek(n).map(function(t,e){return r.th({key:t+e,className:"dow"},t)}))]),r.tbody({key:"tb"},this.renderDays())],e&&t.push(e),r.div({className:"rdtDays"},r.table({},t))},getDaysOfWeek:function(t){var e=t._weekdaysMin,s=t.firstDayOfWeek(),n=[],i=0;return e.forEach(function(t){n[(7+i++-s)%7]=t}),n},renderDays:function(){var t,e,s,n,a=this.props.viewDate,o=this.props.selectedDate&&this.props.selectedDate.clone(),c=a.clone().subtract(1,"months"),l=a.year(),u=a.month(),d=[],p=[],h=this.props.renderDay||this.renderDay,m=this.props.isValidDate||this.alwaysValidDate;c.date(c.daysInMonth()).startOf("week");for(var f=c.clone().add(42,"d");c.isBefore(f);)t="rdtDay",n=c.clone(),c.year()===l&&c.month()<u||c.year()<l?t+=" rdtOld":(c.year()===l&&c.month()>u||c.year()>l)&&(t+=" rdtNew"),o&&c.isSame(o,"day")&&(t+=" rdtActive"),c.isSame(i(),"day")&&(t+=" rdtToday"),e=!m(n,o),e&&(t+=" rdtDisabled"),s={key:c.format("M_D"),"data-value":c.date(),className:t},e||(s.onClick=this.updateSelectedDate),p.push(h(s,n,o)),7===p.length&&(d.push(r.tr({key:c.format("M_D")},p)),p=[]),c.add(1,"d");return d},updateSelectedDate:function(t){this.props.updateSelectedDate(t,!0)},renderDay:function(t,e){return r.td(t,e.date())},renderFooter:function(){if(!this.props.timeFormat)return"";var t=this.props.selectedDate||this.props.viewDate;return r.tfoot({key:"tf"},r.tr({},r.td({onClick:this.props.showView("time"),colSpan:7,className:"rdtTimeToggle"},t.format(this.props.timeFormat))))},alwaysValidDate:function(){return 1},handleClickOutside:function(){this.props.handleClickOutside()}}));t.exports=o},function(t,e,s){var n,i;!function(a){function r(t,e,s){return function(t,n){var i=e.createClass({statics:{getClass:function(){return t.getClass?t.getClass():t}},getInstance:function(){return t.prototype.isReactComponent?this.refs.instance:this},__outsideClickHandler:function(){},getDefaultProps:function(){return{excludeScrollbar:n&&n.excludeScrollbar}},componentDidMount:function(){if("undefined"!=typeof document&&document.createElement){var t,i=this.getInstance();if(n&&"function"==typeof n.handleClickOutside){if(t=n.handleClickOutside(i),"function"!=typeof t)throw new Error("Component lacks a function for processing outside click events specified by the handleClickOutside config option.")}else if("function"==typeof i.handleClickOutside)t=e.Component.prototype.isPrototypeOf(i)?i.handleClickOutside.bind(i):i.handleClickOutside;else{if("function"!=typeof i.props.handleClickOutside)throw new Error("Component lacks a handleClickOutside(event) function for processing outside click events.");t=i.props.handleClickOutside}var a=s.findDOMNode(i);null===a&&(console.warn("Antipattern warning: there was no DOM node associated with the component that is being wrapped by outsideClick."),console.warn(["This is typically caused by having a component that starts life with a render function that","returns `null` (due to a state or props value), so that the component 'exist' in the React","chain of components, but not in the DOM.\n\nInstead, you need to refactor your code so that the","decision of whether or not to show your component is handled by the parent, in their render()","function.\n\nIn code, rather than:\n\n A{render(){return check? <.../> : null;}\n B{render(){<A check=... />}\n\nmake sure that you","use:\n\n A{render(){return <.../>}\n B{render(){return <...>{ check ? <A/> : null }<...>}}\n\nThat is:","the parent is always responsible for deciding whether or not to render any of its children.","It is not the child's responsibility to decide whether a render instruction from above should","get ignored or not by returning `null`.\n\nWhen any component gets its render() function called,","that is the signal that it should be rendering its part of the UI. It may in turn decide not to","render all of *its* children, but it should never return `null` for itself. It is not responsible","for that decision."].join(" ")));var r=this.__outsideClickHandler=f(a,i,t,this.props.outsideClickIgnoreClass||u,this.props.excludeScrollbar,this.props.preventDefault||!1,this.props.stopPropagation||!1),o=c.length;c.push(this),l[o]=r,this.props.disableOnClickOutside||this.enableOnClickOutside()}},componentWillReceiveProps:function(t){this.props.disableOnClickOutside&&!t.disableOnClickOutside?this.enableOnClickOutside():!this.props.disableOnClickOutside&&t.disableOnClickOutside&&this.disableOnClickOutside()},componentWillUnmount:function(){this.disableOnClickOutside(),this.__outsideClickHandler=!1;var t=c.indexOf(this);t>-1&&(l[t]&&l.splice(t,1),c.splice(t,1))},enableOnClickOutside:function(){var t=this.__outsideClickHandler;if("undefined"!=typeof document){var e=this.props.eventTypes||d;e.forEach||(e=[e]),e.forEach(function(e){document.addEventListener(e,t)})}},disableOnClickOutside:function(){var t=this.__outsideClickHandler;if("undefined"!=typeof document){var e=this.props.eventTypes||d;e.forEach||(e=[e]),e.forEach(function(e){document.removeEventListener(e,t)})}},render:function(){var s=this.props,n={};return Object.keys(this.props).forEach(function(t){"excludeScrollbar"!==t&&(n[t]=s[t])}),t.prototype.isReactComponent&&(n.ref="instance"),n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,e.createElement(t,n)}});return function(t,e){var s=t.displayName||t.name||"Component";e.displayName="OnClickOutside("+s+")"}(t,i),i}}function o(a,r){n=[s(3),s(7)],i=function(t,e){return r(a,t,e)}.apply(e,n),!(void 0!==i&&(t.exports=i))}var c=[],l=[],u="ignore-react-onclickoutside",d=["mousedown","touchstart"],p=function(t,e,s){return t===e||(t.correspondingElement?t.correspondingElement.classList.contains(s):t.classList.contains(s))},h=function(t,e,s){if(t===e)return!0;for(;t.parentNode;){if(p(t,e,s))return!0;t=t.parentNode}return t},m=function(t){return document.documentElement.clientWidth<=t.clientX||document.documentElement.clientHeight<=t.clientY},f=function(t,e,s,n,i,a,r){return function(e){a&&e.preventDefault(),r&&e.stopPropagation();var o=e.target;i&&m(e)||h(o,t,n)!==document||s(e)}};o(a,r)}(this)},function(t,e){t.exports=s},function(t,e,s){"use strict";function n(t){return t.charAt(0).toUpperCase()+t.slice(1)}var i=s(3),a=s(6),r=i.DOM,o=a(i.createClass({render:function(){return r.div({className:"rdtMonths"},[r.table({key:"a"},r.thead({},r.tr({},[r.th({key:"prev",className:"rdtPrev"},r.span({onClick:this.props.subtractTime(1,"years")},"‹")),r.th({key:"year",className:"rdtSwitch",onClick:this.props.showView("years"),colSpan:2,"data-value":this.props.viewDate.year()},this.props.viewDate.year()),r.th({key:"next",className:"rdtNext"},r.span({onClick:this.props.addTime(1,"years")},"›"))]))),r.table({key:"months"},r.tbody({key:"b"},this.renderMonths()))])},renderMonths:function(){for(var t,e,s,n,i,a,o,c=this.props.selectedDate,l=this.props.viewDate.month(),u=this.props.viewDate.year(),d=[],p=0,h=[],m=this.props.renderMonth||this.renderMonth,f=this.props.isValidDate||this.alwaysValidDate,v=1;p<12;)t="rdtMonth",s=this.props.viewDate.clone().set({year:u,month:p,date:v}),i=s.endOf("month").format("D"),a=Array.from({length:i},function(t,e){return e+1}),o=a.find(function(t){var e=s.clone().set("date",t);return f(e)}),n=void 0===o,n&&(t+=" rdtDisabled"),c&&p===c.month()&&u===c.year()&&(t+=" rdtActive"),e={key:p,"data-value":p,className:t},n||(e.onClick="months"===this.props.updateOn?this.updateSelectedMonth:this.props.setDate("month")),h.push(m(e,p,u,c&&c.clone())),4===h.length&&(d.push(r.tr({key:l+"_"+d.length},h)),h=[]),p++;return d},updateSelectedMonth:function(t){this.props.updateSelectedDate(t)},renderMonth:function(t,e){var s=this.props.viewDate,i=s.localeData().monthsShort(s.month(e)),a=3,o=i.substring(0,a);return r.td(t,n(o))},alwaysValidDate:function(){return 1},handleClickOutside:function(){this.props.handleClickOutside()}}));t.exports=o},function(t,e,s){"use strict";var n=s(3),i=s(6),a=n.DOM,r=i(n.createClass({render:function(){var t=10*parseInt(this.props.viewDate.year()/10,10);return a.div({className:"rdtYears"},[a.table({key:"a"},a.thead({},a.tr({},[a.th({key:"prev",className:"rdtPrev"},a.span({onClick:this.props.subtractTime(10,"years")},"‹")),a.th({key:"year",className:"rdtSwitch",onClick:this.props.showView("years"),colSpan:2},t+"-"+(t+9)),a.th({key:"next",className:"rdtNext"},a.span({onClick:this.props.addTime(10,"years")},"›"))]))),a.table({key:"years"},a.tbody({},this.renderYears(t)))])},renderYears:function(t){var e,s,n,i,r,o,c,l=[],u=-1,d=[],p=this.props.renderYear||this.renderYear,h=this.props.selectedDate,m=this.props.isValidDate||this.alwaysValidDate,f=0,v=1;for(t--;u<11;)e="rdtYear",n=this.props.viewDate.clone().set({year:t,month:f,date:v}),r=n.endOf("year").format("DDD"),o=Array.from({length:r},function(t,e){return e+1}),c=o.find(function(t){var e=n.clone().dayOfYear(t);return m(e)}),i=void 0===c,i&&(e+=" rdtDisabled"),h&&h.year()===t&&(e+=" rdtActive"),s={key:t,"data-value":t,className:e},i||(s.onClick="years"===this.props.updateOn?this.updateSelectedYear:this.props.setDate("year")),l.push(p(s,t,h&&h.clone())),4===l.length&&(d.push(a.tr({key:u},l)),l=[]),t++,u++;return d},updateSelectedYear:function(t){this.props.updateSelectedDate(t)},renderYear:function(t,e){return a.td(t,e)},alwaysValidDate:function(){return 1},handleClickOutside:function(){this.props.handleClickOutside()}}));t.exports=r},function(t,e,s){"use strict";var n=s(3),i=s(1),a=s(6),r=n.DOM,o=a(n.createClass({getInitialState:function(){return this.calculateState(this.props)},calculateState:function(t){var e=t.selectedDate||t.viewDate,s=t.timeFormat,n=[];s.toLowerCase().indexOf("h")!==-1&&(n.push("hours"),s.indexOf("m")!==-1&&(n.push("minutes"),s.indexOf("s")!==-1&&n.push("seconds")));var i=!1;return null!==this.state&&this.props.timeFormat.toLowerCase().indexOf(" a")!==-1&&(i=this.props.timeFormat.indexOf(" A")!==-1?this.state.hours>=12?"PM":"AM":this.state.hours>=12?"pm":"am"),{hours:e.format("H"),minutes:e.format("mm"),seconds:e.format("ss"),milliseconds:e.format("SSS"),daypart:i,counters:n}},renderCounter:function(t){if("daypart"!==t){var e=this.state[t];return"hours"===t&&this.props.timeFormat.toLowerCase().indexOf(" a")!==-1&&(e=(e-1)%12+1,0===e&&(e=12)),r.div({key:t,className:"rdtCounter"},[r.span({key:"up",className:"rdtBtn",onMouseDown:this.onStartClicking("increase",t)},"▲"),r.div({key:"c",className:"rdtCount"},e),r.span({key:"do",className:"rdtBtn",onMouseDown:this.onStartClicking("decrease",t)},"▼")])}return""},renderDayPart:function(){return r.div({key:"dayPart",className:"rdtCounter"},[r.span({key:"up",className:"rdtBtn",onMouseDown:this.onStartClicking("toggleDayPart","hours")},"▲"),r.div({key:this.state.daypart,className:"rdtCount"},this.state.daypart),r.span({key:"do",className:"rdtBtn",onMouseDown:this.onStartClicking("toggleDayPart","hours")},"▼")])},render:function(){var t=this,e=[];return this.state.counters.forEach(function(s){e.length&&e.push(r.div({key:"sep"+e.length,className:"rdtCounterSeparator"},":")),e.push(t.renderCounter(s))}),this.state.daypart!==!1&&e.push(t.renderDayPart()),3===this.state.counters.length&&this.props.timeFormat.indexOf("S")!==-1&&(e.push(r.div({className:"rdtCounterSeparator",key:"sep5"},":")),e.push(r.div({className:"rdtCounter rdtMilli",key:"m"},r.input({value:this.state.milliseconds,type:"text",onChange:this.updateMilli})))),r.div({className:"rdtTime"},r.table({},[this.renderHeader(),r.tbody({key:"b"},r.tr({},r.td({},r.div({className:"rdtCounters"},e))))]))},componentWillMount:function(){var t=this;t.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(e){i(t.timeConstraints[e],t.props.timeConstraints[e])}),this.setState(this.calculateState(this.props))},componentWillReceiveProps:function(t){this.setState(this.calculateState(t))},updateMilli:function(t){var e=parseInt(t.target.value,10);e===t.target.value&&e>=0&&e<1e3&&(this.props.setTime("milliseconds",e),this.setState({milliseconds:e}))},renderHeader:function(){if(!this.props.dateFormat)return null;var t=this.props.selectedDate||this.props.viewDate;return r.thead({key:"h"},r.tr({},r.th({className:"rdtSwitch",colSpan:4,onClick:this.props.showView("days")},t.format(this.props.dateFormat))))},onStartClicking:function(t,e){var s=this;return function(){var n={};n[e]=s[t](e),s.setState(n),s.timer=setTimeout(function(){s.increaseTimer=setInterval(function(){n[e]=s[t](e),s.setState(n)},70)},500),s.mouseUpListener=function(){clearTimeout(s.timer),clearInterval(s.increaseTimer),s.props.setTime(e,s.state[e]),document.body.removeEventListener("mouseup",s.mouseUpListener)},document.body.addEventListener("mouseup",s.mouseUpListener)}},padValues:{hours:1,minutes:2,seconds:2,milliseconds:3},toggleDayPart:function(t){var e=parseInt(this.state[t],10)+12;return e>this.timeConstraints[t].max&&(e=this.timeConstraints[t].min+(e-(this.timeConstraints[t].max+1))),this.pad(t,e)},increase:function(t){var e=parseInt(this.state[t],10)+this.timeConstraints[t].step;return e>this.timeConstraints[t].max&&(e=this.timeConstraints[t].min+(e-(this.timeConstraints[t].max+1))),this.pad(t,e)},decrease:function(t){var e=parseInt(this.state[t],10)-this.timeConstraints[t].step;return e<this.timeConstraints[t].min&&(e=this.timeConstraints[t].max+1-(this.timeConstraints[t].min-e)),this.pad(t,e)},pad:function(t,e){for(var s=e+"";s.length<this.padValues[t];)s="0"+s;return s},handleClickOutside:function(){this.props.handleClickOutside()}}));t.exports=o}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React"),require("moment"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","moment","ReactDOM"],e):"object"==typeof exports?exports.Datetime=e(require("React"),require("moment"),require("ReactDOM")):t.Datetime=e(t.React,t.moment,t.ReactDOM)}(this,function(t,e,n){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1),o=n(2),i=n(11),a=n(16),s=n(12),c=n(17),u=o,l=i({propTypes:{onFocus:u.func,onBlur:u.func,onChange:u.func,locale:u.string,utc:u.bool,input:u.bool,inputProps:u.object,timeConstraints:u.object,viewMode:u.oneOf(["years","months","days","time"]),isValidDate:u.func,open:u.bool,strictParsing:u.bool,closeOnSelect:u.bool,closeOnTab:u.bool},getDefaultProps:function(){var t=function(){};return{className:"",defaultValue:"",inputProps:{},input:!0,onFocus:t,onBlur:t,onChange:t,timeFormat:!0,timeConstraints:{},dateFormat:!0,strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,utc:!1}},getInitialState:function(){var t=this.getStateFromProps(this.props);return void 0===t.open&&(t.open=!this.props.input),t.currentView=this.props.dateFormat?this.props.viewMode||t.updateOn||"days":"time",t},getStateFromProps:function(t){var e,n,r,o,i=this.getFormats(t),a=t.value||t.defaultValue;return a&&"string"==typeof a?e=this.localMoment(a,i.datetime):a&&(e=this.localMoment(a)),e&&!e.isValid()&&(e=null),n=e?e.clone().startOf("month"):this.localMoment().startOf("month"),r=this.getUpdateOn(i),o=e?e.format(i.datetime):a.isValid&&!a.isValid()?"":a||"",{updateOn:r,inputFormat:i.datetime,viewDate:n,selectedDate:e,inputValue:o,open:t.open}},getUpdateOn:function(t){return t.date.match(/[lLD]/)?"days":t.date.indexOf("M")!==-1?"months":t.date.indexOf("Y")!==-1?"years":"days"},getFormats:function(t){var e={date:t.dateFormat||"",time:t.timeFormat||""},n=this.localMoment(t.date,null,t).localeData();return e.date===!0?e.date=n.longDateFormat("L"):"days"!==this.getUpdateOn(e)&&(e.time=""),e.time===!0&&(e.time=n.longDateFormat("LT")),e.datetime=e.date&&e.time?e.date+" "+e.time:e.date||e.time,e},componentWillReceiveProps:function(t){var e=this.getFormats(t),n={};if(t.value===this.props.value&&e.datetime===this.getFormats(this.props).datetime||(n=this.getStateFromProps(t)),void 0===n.open&&(this.props.closeOnSelect&&"time"!==this.state.currentView?n.open=!1:n.open=this.state.open),t.viewMode!==this.props.viewMode&&(n.currentView=t.viewMode),t.locale!==this.props.locale){if(this.state.viewDate){var r=this.state.viewDate.clone().locale(t.locale);n.viewDate=r}if(this.state.selectedDate){var o=this.state.selectedDate.clone().locale(t.locale);n.selectedDate=o,n.inputValue=o.format(e.datetime)}}t.utc!==this.props.utc&&(t.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(e.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(e.datetime)))),this.setState(n)},onInputChange:function(t){var e=null===t.target?t:t.target.value,n=this.localMoment(e,this.state.inputFormat),r={inputValue:e};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(t){9===t.which&&this.props.closeOnTab&&this.closeCalendar()},showView:function(t){var e=this;return function(){e.setState({currentView:t})}},setDate:function(t){var e=this,n={month:"days",year:"months"};return function(r){e.setState({viewDate:e.state.viewDate.clone()[t](parseInt(r.target.getAttribute("data-value"),10)).startOf(t),currentView:n[t]})}},addTime:function(t,e,n){return this.updateTime("add",t,e,n)},subtractTime:function(t,e,n){return this.updateTime("subtract",t,e,n)},updateTime:function(t,e,n,r){var o=this;return function(){var i={},a=r?"selectedDate":"viewDate";i[a]=o.state[a].clone()[t](e,n),o.setState(i)}},allowedSetTime:["hours","minutes","seconds","milliseconds"],setTime:function(t,e){var n,r=this.allowedSetTime.indexOf(t)+1,o=this.state,i=(o.selectedDate||o.viewDate).clone();for(i[t](e);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(t,e){var n,r=t.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&&e&&this.closeCalendar();else{var s=!(this.props.closeOnSelect&&e);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(){this.state.open||this.setState({open:!0},function(){this.props.onFocus()})},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.setState({open:!1},function(){this.props.onBlur(this.state.selectedDate||this.state.inputValue)})},localMoment:function(t,e,n){n=n||this.props;var r=n.utc?a.utc:a,o=r(t,e,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 t=this,e=this.getFormats(this.props),n={dateFormat:e.date,timeFormat:e.time};return this.componentProps.fromProps.forEach(function(e){n[e]=t.props[e]}),this.componentProps.fromState.forEach(function(e){n[e]=t.state[e]}),this.componentProps.fromThis.forEach(function(e){n[e]=t[e]}),n},render:function(){var t=s.DOM,e="rdt"+(this.props.className?Array.isArray(this.props.className)?" "+this.props.className.join(" "):" "+this.props.className:""),n=[];return this.props.input?n=[t.input(r({key:"i",type:"text",className:"form-control",onFocus:this.openCalendar,onChange:this.onInputChange,onKeyDown:this.onInputKey,value:this.state.inputValue},this.props.inputProps))]:e+=" rdtStatic",this.state.open&&(e+=" rdtOpen"),t.div({className:e},n.concat(t.div({key:"dt",className:"rdtPicker"},s.createElement(c,{view:this.state.currentView,viewProps:this.getComponentProps(),onClickOutside:this.handleClickOutside}))))}});l.moment=a,t.exports=l},function(t,e){"use strict";function n(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function r(t){var e=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(t))),e.filter(function(e){return o.call(t,e)})}var o=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(t,e){for(var o,i,a=n(t),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(t,e,n){(function(e){if("production"!==e.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,o=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},i=!0;t.exports=n(4)(o,i)}else t.exports=n(10)()}).call(e,n(3))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function i(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function a(){m&&h&&(m=!1,h.length?f=h.concat(f):y=-1,f.length&&s())}function s(){if(!m){var t=o(a);m=!0;for(var e=f.length;e;){for(h=f,f=[];++y<e;)h&&h[y].run();y=-1,e=f.length}h=null,m=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var l,p,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(t){p=r}}();var h,f=[],m=!1,y=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new c(t,e)),1!==f.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.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(t,e,n){(function(e){"use strict";var r=n(5),o=n(6),i=n(7),a=n(8),s=n(9);t.exports=function(t,n){function c(t){var e=t&&(x&&t[x]||t[_]);if("function"==typeof e)return e}function u(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e}function l(t){this.message=t,this.stack=""}function p(t){function r(r,u,p,d,h,f,m){if(d=d||S,f=f||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"!==e.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.",f,d),s[y]=!0,c++)}return null==u[p]?r?new l(null===u[p]?"The "+h+" `"+f+"` is marked as required "+("in `"+d+"`, but its value is `null`."):"The "+h+" `"+f+"` is marked as required in "+("`"+d+"`, but its value is `undefined`.")):null:t(u,p,d,h,f)}if("production"!==e.env.NODE_ENV)var s={},c=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function d(t){function e(e,n,r,o,i,a){var s=e[n],c=E(s);if(c!==t){var u=C(s);return new l("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("`"+t+"`."))}return null}return p(e)}function h(){return p(r.thatReturnsNull)}function f(t){function e(e,n,r,o,i){if("function"!=typeof t)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=e[n];if(!Array.isArray(s)){var c=E(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=t(s,u,r,o,i+"["+u+"]",a);if(p instanceof Error)return p}return null}return p(e)}function m(){function e(e,n,r,o,i){var a=e[n];if(!t(a)){var s=E(a);return new l("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return p(e)}function y(t){function e(e,n,r,o,i){if(!(e[n]instanceof t)){var a=t.name||S,s=k(e[n]);return new l("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return p(e)}function v(t){function n(e,n,r,o,i){for(var a=e[n],s=0;s<t.length;s++)if(u(a,t[s]))return null;var c=JSON.stringify(t);return new l("Invalid "+o+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+c+"."))}return Array.isArray(t)?p(n):("production"!==e.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function g(t){function e(e,n,r,o,i){if("function"!=typeof t)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=e[n],c=E(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=t(s,u,r,o,i+"."+u,a);if(p instanceof Error)return p}return null}return p(e)}function D(t){function n(e,n,r,o,i){for(var s=0;s<t.length;s++){var c=t[s];if(null==c(e,n,r,o,i,a))return null}return new l("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}return Array.isArray(t)?p(n):("production"!==e.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull)}function O(){function t(t,e,n,r,o){return w(t[e])?null:new l("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return p(t)}function b(t){function e(e,n,r,o,i){var s=e[n],c=E(s);if("object"!==c)return new l("Invalid "+o+" `"+i+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var u in t){var p=t[u];if(p){var d=p(s,u,r,o,i+"."+u,a);if(d)return d}}return null}return p(e)}function w(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(w);if(null===e||t(e))return!0;var n=c(e);if(!n)return!1;var r,o=n.call(e);if(n!==e.entries){for(;!(r=o.next()).done;)if(!w(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!w(i[1]))return!1}return!0;default:return!1}}function N(t,e){return"symbol"===t||("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}function E(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":N(e,t)?"symbol":e}function C(t){var e=E(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function k(t){return t.constructor&&t.constructor.name?t.constructor.name:S}var x="function"==typeof Symbol&&Symbol.iterator,_="@@iterator",S="<<anonymous>>",T={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:h(),arrayOf:f,element:m(),instanceOf:y,node:O(),objectOf:g,oneOf:v,oneOfType:D,shape:b};return l.prototype=Error.prototype,T.checkPropTypes=s,T.PropTypes=T,T}}).call(e,n(3))},function(t,e){"use strict";function n(t){return function(){return t}}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(t){return t},t.exports=r},function(t,e,n){(function(e){"use strict";function n(t,e,n,o,i,a,s,c){if(r(e),!t){var u;if(void 0===e)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(e.replace(/%s/g,function(){return l[p++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}var r=function(t){};"production"!==e.env.NODE_ENV&&(r=function(t){if(void 0===t)throw new Error("invariant requires an error message argument")}),t.exports=n}).call(e,n(3))},function(t,e,n){(function(e){"use strict";var r=n(5),o=r;"production"!==e.env.NODE_ENV&&!function(){var t=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+t.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(a){}};o=function(e,n){if(void 0===n)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==n.indexOf("Failed Composite propType: ")&&!e){for(var r=arguments.length,o=Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];t.apply(void 0,[n].concat(o))}}}(),t.exports=o}).call(e,n(3))},function(t,e){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=n},function(t,e,n){(function(e){"use strict";function r(t,n,r,c,u){if("production"!==e.env.NODE_ENV)for(var l in t)if(t.hasOwnProperty(l)){var p;try{o("function"==typeof t[l],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",c||"React class",r,l),p=t[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 h=u?u():"";i(!1,"Failed %s type: %s%s",r,p.message,null!=h?h:"")}}}if("production"!==e.env.NODE_ENV)var o=n(6),i=n(7),a=n(8),s={};t.exports=r}).call(e,n(3))},function(t,e,n){"use strict";var r=n(5),o=n(6);t.exports=function(){function t(){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 e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";var r=n(12),o=n(13),i=(new r.Component).updater;t.exports=o(r.Component,r.isValidElement,i)},function(e,n){e.exports=t},function(t,e,n){(function(e){"use strict";function r(t){return t}function o(t,n,o){function p(t,n,r){for(var o in n)n.hasOwnProperty(o)&&("production"!==e.env.NODE_ENV?c("function"==typeof n[o],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",t.displayName||"ReactClass",u[r],o):void 0)}function d(t,e){var n=w.hasOwnProperty(e)?w[e]:null;C.hasOwnProperty(e)&&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.",e),t&&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.",e)}function h(t,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=t.prototype,i=o.__reactAutoBindPairs;r.hasOwnProperty(l)&&N.mixins(t,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),N.hasOwnProperty(a))N[a](t,u);else{var h=w.hasOwnProperty(a),f="function"==typeof u,m=f&&!h&&!p&&r.autobind!==!1;if(m)i.push(a,u),o[a]=u;else if(p){var g=w[a];s(h&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,a),"DEFINE_MANY_MERGED"===g?o[a]=y(o[a],u):"DEFINE_MANY"===g&&(o[a]=v(o[a],u))}else o[a]=u,"production"!==e.env.NODE_ENV&&"function"==typeof u&&r.displayName&&(o[a].displayName=r.displayName+"_"+a)}}}else if("production"!==e.env.NODE_ENV){var D=typeof r,O="object"===D&&null!==r;"production"!==e.env.NODE_ENV?c(O,"%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.",t.displayName||"ReactClass",null===r?null:D):void 0}}function f(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var o=n in N;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 t;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),t[n]=r}}}function m(t,e){s(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in e)e.hasOwnProperty(n)&&(s(void 0===t[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),t[n]=e[n]);return t}function y(t,e){return function(){var n=t.apply(this,arguments),r=e.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(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function g(t,n){var r=n.bind(t);if("production"!==e.env.NODE_ENV){r.__reactBoundContext=t,r.__reactBoundMethod=n,r.__reactBoundArguments=null;var o=t.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!==t&&null!==a)"production"!==e.env.NODE_ENV?c(!1,"bind(): React component methods may only be bound to the component instance. See %s",o):void 0;else if(!u.length)return"production"!==e.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):void 0,r;var p=i.apply(r,arguments);return p.__reactBoundContext=t,p.__reactBoundMethod=n,p.__reactBoundArguments=u,p}}return r}function D(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];t[r]=g(t,o)}}function O(t){var n=r(function(t,r,i){"production"!==e.env.NODE_ENV&&("production"!==e.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"):void 0),this.__reactAutoBindPairs.length&&D(this),this.props=t,this.context=r,this.refs=a,this.updater=i||o,this.state=null;var u=this.getInitialState?this.getInitialState():null;"production"!==e.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 k,n.prototype.constructor=n,n.prototype.__reactAutoBindPairs=[],b.forEach(h.bind(null,n)),h(n,E),h(n,t),n.getDefaultProps&&(n.defaultProps=n.getDefaultProps()),"production"!==e.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"!==e.env.NODE_ENV&&("production"!==e.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.",t.displayName||"A component"):void 0,"production"!==e.env.NODE_ENV?c(!n.prototype.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",t.displayName||"A component"):void 0);for(var i in w)n.prototype[i]||(n.prototype[i]=null);return n}var b=[],w={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"},N={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)h(t,e[n])},childContextTypes:function(t,n){"production"!==e.env.NODE_ENV&&p(t,n,"childContext"),t.childContextTypes=i({},t.childContextTypes,n)},contextTypes:function(t,n){"production"!==e.env.NODE_ENV&&p(t,n,"context"),t.contextTypes=i({},t.contextTypes,n)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=y(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,n){"production"!==e.env.NODE_ENV&&p(t,n,"prop"),t.propTypes=i({},t.propTypes,n)},statics:function(t,e){f(t,e)},autobind:function(){}},E={componentDidMount:function(){this.__isMounted=!0},componentWillUnmount:function(){this.__isMounted=!1}},C={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e)},isMounted:function(){return"production"!==e.env.NODE_ENV&&("production"!==e.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"):void 0,this.__didWarnIsMounted=!0),!!this.__isMounted}},k=function(){};return i(k.prototype,t.prototype,C),O}var i=n(14),a=n(15),s=n(6);if("production"!==e.env.NODE_ENV)var c=n(7);var u,l="mixins";u="production"!==e.env.NODE_ENV?{prop:"prop",context:"context",childContext:"child context"}:{},t.exports=o}).call(e,n(3))},function(t,e){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function r(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(i){return!1}}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=r()?Object.assign:function(t,e){for(var r,s,c=n(t),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(t,e,n){(function(e){"use strict";var n={};"production"!==e.env.NODE_ENV&&Object.freeze(n),t.exports=n}).call(e,n(3))},function(t,n){t.exports=e},function(t,e,n){var r=n(12),o=n(11),i=n(18),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)}});t.exports=u},function(t,e,n){"use strict";var r=n(12),o=n(11),i=n(16),a=n(19),s=r.DOM,c=a(o({render:function(){var t,e=this.renderFooter(),n=this.props.viewDate,r=n.localeData();return t=[s.thead({key:"th"},[s.tr({key:"h"},[s.th({key:"p",className:"rdtPrev",onClick:this.props.subtractTime(1,"months")},s.span({},"‹")),s.th({key:"s",className:"rdtSwitch",onClick:this.props.showView("months"),colSpan:5,"data-value":this.props.viewDate.month()},r.months(n)+" "+n.year()),s.th({key:"n",className:"rdtNext",onClick:this.props.addTime(1,"months")},s.span({},"›"))]),s.tr({key:"d"},this.getDaysOfWeek(r).map(function(t,e){return s.th({key:t+e,className:"dow"},t)}))]),s.tbody({key:"tb"},this.renderDays())],e&&t.push(e),s.div({className:"rdtDays"},s.table({},t))},getDaysOfWeek:function(t){var e=t._weekdaysMin,n=t.firstDayOfWeek(),r=[],o=0;return e.forEach(function(t){r[(7+o++-n)%7]=t}),r},renderDays:function(){var t,e,n,r,o=this.props.viewDate,a=this.props.selectedDate&&this.props.selectedDate.clone(),c=o.clone().subtract(1,"months"),u=o.year(),l=o.month(),p=[],d=[],h=this.props.renderDay||this.renderDay,f=this.props.isValidDate||this.alwaysValidDate;c.date(c.daysInMonth()).startOf("week");for(var m=c.clone().add(42,"d");c.isBefore(m);)t="rdtDay",r=c.clone(),c.year()===u&&c.month()<l||c.year()<u?t+=" rdtOld":(c.year()===u&&c.month()>l||c.year()>u)&&(t+=" rdtNew"),a&&c.isSame(a,"day")&&(t+=" rdtActive"),c.isSame(i(),"day")&&(t+=" rdtToday"),e=!f(r,a),e&&(t+=" rdtDisabled"),n={key:c.format("M_D"),"data-value":c.date(),className:t},e||(n.onClick=this.updateSelectedDate),d.push(h(n,r,a)),7===d.length&&(p.push(s.tr({key:c.format("M_D")},d)),d=[]),c.add(1,"d");return p},updateSelectedDate:function(t){this.props.updateSelectedDate(t,!0)},renderDay:function(t,e){return s.td(t,e.date())},renderFooter:function(){if(!this.props.timeFormat)return"";var t=this.props.selectedDate||this.props.viewDate;return s.tfoot({key:"tf"},s.tr({},s.td({onClick:this.props.showView("time"),colSpan:7,className:"rdtTimeToggle"},t.format(this.props.timeFormat))))},alwaysValidDate:function(){return 1},handleClickOutside:function(){this.props.handleClickOutside()}}));t.exports=c},function(t,e,n){var r,o;!function(i){function a(t,e,n,r){return function(t,o){var i=r({statics:{getClass:function(){return t.getClass?t.getClass():t}},getInstance:function(){return t.prototype.isReactComponent?this.refs.instance:this},__outsideClickHandler:function(){},getDefaultProps:function(){return{excludeScrollbar:o&&o.excludeScrollbar}},componentDidMount:function(){if("undefined"!=typeof document&&document.createElement){var t,r=this.getInstance();if(o&&"function"==typeof o.handleClickOutside){if(t=o.handleClickOutside(r),"function"!=typeof t)throw new Error("Component lacks a function for processing outside click events specified by the handleClickOutside config option.")}else if("function"==typeof r.handleClickOutside)t=e.Component.prototype.isPrototypeOf(r)?r.handleClickOutside.bind(r):r.handleClickOutside;else{if("function"!=typeof r.props.handleClickOutside)throw new Error("Component lacks a handleClickOutside(event) function for processing outside click events.");t=r.props.handleClickOutside}var i=n.findDOMNode(r);null===i&&(console.warn("Antipattern warning: there was no DOM node associated with the component that is being wrapped by outsideClick."),console.warn(["This is typically caused by having a component that starts life with a render function that","returns `null` (due to a state or props value), so that the component 'exist' in the React","chain of components, but not in the DOM.\n\nInstead, you need to refactor your code so that the","decision of whether or not to show your component is handled by the parent, in their render()","function.\n\nIn code, rather than:\n\n A{render(){return check? <.../> : null;}\n B{render(){<A check=... />}\n\nmake sure that you","use:\n\n A{render(){return <.../>}\n B{render(){return <...>{ check ? <A/> : null }<...>}}\n\nThat is:","the parent is always responsible for deciding whether or not to render any of its children.","It is not the child's responsibility to decide whether a render instruction from above should","get ignored or not by returning `null`.\n\nWhen any component gets its render() function called,","that is the signal that it should be rendering its part of the UI. It may in turn decide not to","render all of *its* children, but it should never return `null` for itself. It is not responsible","for that decision."].join(" ")));var a=this.__outsideClickHandler=m(i,r,t,this.props.outsideClickIgnoreClass||l,this.props.excludeScrollbar,this.props.preventDefault||!1,this.props.stopPropagation||!1),s=c.length;c.push(this),u[s]=a,this.props.disableOnClickOutside||this.enableOnClickOutside()}},componentWillReceiveProps:function(t){ | ||
this.props.disableOnClickOutside&&!t.disableOnClickOutside?this.enableOnClickOutside():!this.props.disableOnClickOutside&&t.disableOnClickOutside&&this.disableOnClickOutside()},componentWillUnmount:function(){this.disableOnClickOutside(),this.__outsideClickHandler=!1;var t=c.indexOf(this);t>-1&&(u[t]&&u.splice(t,1),c.splice(t,1))},enableOnClickOutside:function(){var t=this.__outsideClickHandler;if("undefined"!=typeof document){var e=this.props.eventTypes||p;e.forEach||(e=[e]),e.forEach(function(e){document.addEventListener(e,t)})}},disableOnClickOutside:function(){var t=this.__outsideClickHandler;if("undefined"!=typeof document){var e=this.props.eventTypes||p;e.forEach||(e=[e]),e.forEach(function(e){document.removeEventListener(e,t)})}},render:function(){var n=this.props,r={};return Object.keys(this.props).forEach(function(t){"excludeScrollbar"!==t&&(r[t]=n[t])}),t.prototype.isReactComponent&&(r.ref="instance"),r.disableOnClickOutside=this.disableOnClickOutside,r.enableOnClickOutside=this.enableOnClickOutside,e.createElement(t,r)}});return function(t,e){var n=t.displayName||t.name||"Component";e.displayName="OnClickOutside("+n+")"}(t,i),i}}function s(i,a){r=[n(12),n(20),n(11)],o=function(t,e,n){return n||(n=t.createClass),a(i,t,e,n)}.apply(e,r),!(void 0!==o&&(t.exports=o))}var c=[],u=[],l="ignore-react-onclickoutside",p=["mousedown","touchstart"],d=function(t,e,n){return t===e||(t.correspondingElement?t.correspondingElement.classList.contains(n):t.classList.contains(n))},h=function(t,e,n){if(t===e)return!0;for(;t.parentNode;){if(d(t,e,n))return!0;t=t.parentNode}return t},f=function(t){return document.documentElement.clientWidth<=t.clientX||document.documentElement.clientHeight<=t.clientY},m=function(t,e,n,r,o,i,a){return function(e){i&&e.preventDefault(),a&&e.stopPropagation();var s=e.target;o&&f(e)||h(s,t,r)!==document||n(e)}};s(i,a)}(this)},function(t,e){t.exports=n},function(t,e,n){"use strict";function r(t){return t.charAt(0).toUpperCase()+t.slice(1)}var o=n(12),i=n(11),a=n(19),s=o.DOM,c=a(i({render:function(){return s.div({className:"rdtMonths"},[s.table({key:"a"},s.thead({},s.tr({},[s.th({key:"prev",className:"rdtPrev",onClick:this.props.subtractTime(1,"years")},s.span({},"‹")),s.th({key:"year",className:"rdtSwitch",onClick:this.props.showView("years"),colSpan:2,"data-value":this.props.viewDate.year()},this.props.viewDate.year()),s.th({key:"next",className:"rdtNext",onClick:this.props.addTime(1,"years")},s.span({},"›"))]))),s.table({key:"months"},s.tbody({key:"b"},this.renderMonths()))])},renderMonths:function(){for(var t,e,n,r,o,i,a,c=this.props.selectedDate,u=this.props.viewDate.month(),l=this.props.viewDate.year(),p=[],d=0,h=[],f=this.props.renderMonth||this.renderMonth,m=this.props.isValidDate||this.alwaysValidDate,y=1;d<12;)t="rdtMonth",n=this.props.viewDate.clone().set({year:l,month:d,date:y}),o=n.endOf("month").format("D"),i=Array.from({length:o},function(t,e){return e+1}),a=i.find(function(t){var e=n.clone().set("date",t);return m(e)}),r=void 0===a,r&&(t+=" rdtDisabled"),c&&d===c.month()&&l===c.year()&&(t+=" rdtActive"),e={key:d,"data-value":d,className:t},r||(e.onClick="months"===this.props.updateOn?this.updateSelectedMonth:this.props.setDate("month")),h.push(f(e,d,l,c&&c.clone())),4===h.length&&(p.push(s.tr({key:u+"_"+p.length},h)),h=[]),d++;return p},updateSelectedMonth:function(t){this.props.updateSelectedDate(t)},renderMonth:function(t,e){var n=this.props.viewDate,o=n.localeData().monthsShort(n.month(e)),i=3,a=o.substring(0,i);return s.td(t,r(a))},alwaysValidDate:function(){return 1},handleClickOutside:function(){this.props.handleClickOutside()}}));t.exports=c},function(t,e,n){"use strict";var r=n(12),o=n(11),i=n(19),a=r.DOM,s=i(o({render:function(){var t=10*parseInt(this.props.viewDate.year()/10,10);return a.div({className:"rdtYears"},[a.table({key:"a"},a.thead({},a.tr({},[a.th({key:"prev",className:"rdtPrev",onClick:this.props.subtractTime(10,"years")},a.span({},"‹")),a.th({key:"year",className:"rdtSwitch",onClick:this.props.showView("years"),colSpan:2},t+"-"+(t+9)),a.th({key:"next",className:"rdtNext",onClick:this.props.addTime(10,"years")},a.span({},"›"))]))),a.table({key:"years"},a.tbody({},this.renderYears(t)))])},renderYears:function(t){var e,n,r,o,i,s,c,u=[],l=-1,p=[],d=this.props.renderYear||this.renderYear,h=this.props.selectedDate,f=this.props.isValidDate||this.alwaysValidDate,m=0,y=1;for(t--;l<11;)e="rdtYear",r=this.props.viewDate.clone().set({year:t,month:m,date:y}),i=r.endOf("year").format("DDD"),s=Array.from({length:i},function(t,e){return e+1}),c=s.find(function(t){var e=r.clone().dayOfYear(t);return f(e)}),o=void 0===c,o&&(e+=" rdtDisabled"),h&&h.year()===t&&(e+=" rdtActive"),n={key:t,"data-value":t,className:e},o||(n.onClick="years"===this.props.updateOn?this.updateSelectedYear:this.props.setDate("year")),u.push(d(n,t,h&&h.clone())),4===u.length&&(p.push(a.tr({key:l},u)),u=[]),t++,l++;return p},updateSelectedYear:function(t){this.props.updateSelectedDate(t)},renderYear:function(t,e){return a.td(t,e)},alwaysValidDate:function(){return 1},handleClickOutside:function(){this.props.handleClickOutside()}}));t.exports=s},function(t,e,n){"use strict";var r=n(12),o=n(11),i=n(1),a=n(19),s=r.DOM,c=a(o({getInitialState:function(){return this.calculateState(this.props)},calculateState:function(t){var e=t.selectedDate||t.viewDate,n=t.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=!1;return null!==this.state&&this.props.timeFormat.toLowerCase().indexOf(" a")!==-1&&(o=this.props.timeFormat.indexOf(" A")!==-1?this.state.hours>=12?"PM":"AM":this.state.hours>=12?"pm":"am"),{hours:e.format("H"),minutes:e.format("mm"),seconds:e.format("ss"),milliseconds:e.format("SSS"),daypart:o,counters:r}},renderCounter:function(t){if("daypart"!==t){var e=this.state[t];return"hours"===t&&this.props.timeFormat.toLowerCase().indexOf(" a")!==-1&&(e=(e-1)%12+1,0===e&&(e=12)),s.div({key:t,className:"rdtCounter"},[s.span({key:"up",className:"rdtBtn",onMouseDown:this.onStartClicking("increase",t)},"▲"),s.div({key:"c",className:"rdtCount"},e),s.span({key:"do",className:"rdtBtn",onMouseDown:this.onStartClicking("decrease",t)},"▼")])}return""},renderDayPart:function(){return s.div({key:"dayPart",className:"rdtCounter"},[s.span({key:"up",className:"rdtBtn",onMouseDown:this.onStartClicking("toggleDayPart","hours")},"▲"),s.div({key:this.state.daypart,className:"rdtCount"},this.state.daypart),s.span({key:"do",className:"rdtBtn",onMouseDown:this.onStartClicking("toggleDayPart","hours")},"▼")])},render:function(){var t=this,e=[];return this.state.counters.forEach(function(n){e.length&&e.push(s.div({key:"sep"+e.length,className:"rdtCounterSeparator"},":")),e.push(t.renderCounter(n))}),this.state.daypart!==!1&&e.push(t.renderDayPart()),3===this.state.counters.length&&this.props.timeFormat.indexOf("S")!==-1&&(e.push(s.div({className:"rdtCounterSeparator",key:"sep5"},":")),e.push(s.div({className:"rdtCounter rdtMilli",key:"m"},s.input({value:this.state.milliseconds,type:"text",onChange:this.updateMilli})))),s.div({className:"rdtTime"},s.table({},[this.renderHeader(),s.tbody({key:"b"},s.tr({},s.td({},s.div({className:"rdtCounters"},e))))]))},componentWillMount:function(){var t=this;t.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(e){i(t.timeConstraints[e],t.props.timeConstraints[e])}),this.setState(this.calculateState(this.props))},componentWillReceiveProps:function(t){this.setState(this.calculateState(t))},updateMilli:function(t){var e=parseInt(t.target.value,10);e===t.target.value&&e>=0&&e<1e3&&(this.props.setTime("milliseconds",e),this.setState({milliseconds:e}))},renderHeader:function(){if(!this.props.dateFormat)return null;var t=this.props.selectedDate||this.props.viewDate;return s.thead({key:"h"},s.tr({},s.th({className:"rdtSwitch",colSpan:4,onClick:this.props.showView("days")},t.format(this.props.dateFormat))))},onStartClicking:function(t,e){var n=this;return function(){var r={};r[e]=n[t](e),n.setState(r),n.timer=setTimeout(function(){n.increaseTimer=setInterval(function(){r[e]=n[t](e),n.setState(r)},70)},500),n.mouseUpListener=function(){clearTimeout(n.timer),clearInterval(n.increaseTimer),n.props.setTime(e,n.state[e]),document.body.removeEventListener("mouseup",n.mouseUpListener)},document.body.addEventListener("mouseup",n.mouseUpListener)}},padValues:{hours:1,minutes:2,seconds:2,milliseconds:3},toggleDayPart:function(t){var e=parseInt(this.state[t],10)+12;return e>this.timeConstraints[t].max&&(e=this.timeConstraints[t].min+(e-(this.timeConstraints[t].max+1))),this.pad(t,e)},increase:function(t){var e=parseInt(this.state[t],10)+this.timeConstraints[t].step;return e>this.timeConstraints[t].max&&(e=this.timeConstraints[t].min+(e-(this.timeConstraints[t].max+1))),this.pad(t,e)},decrease:function(t){var e=parseInt(this.state[t],10)-this.timeConstraints[t].step;return e<this.timeConstraints[t].min&&(e=this.timeConstraints[t].max+1-(this.timeConstraints[t].min-e)),this.pad(t,e)},pad:function(t,e){for(var n=e+"";n.length<this.padValues[t];)n="0"+n;return n},handleClickOutside:function(){this.props.handleClickOutside()}}));t.exports=c}])}); | ||
//# sourceMappingURL=react-datetime.min.js.map |
{ | ||
"name": "react-datetime", | ||
"version": "2.8.9", | ||
"version": "2.8.10", | ||
"description": "A lightweight but complete datetime picker React.js component.", | ||
@@ -79,3 +79,5 @@ "homepage": "https://github.com/YouCanBookMe/react-datetime", | ||
"dependencies": { | ||
"create-react-class": "^15.5.2", | ||
"object-assign": "^3.0.0", | ||
"prop-types": "^15.5.7", | ||
"react-onclickoutside": "^5.9.0" | ||
@@ -82,0 +84,0 @@ }, |
@@ -165,3 +165,3 @@ # react-datetime | ||
## Contributions | ||
* For information about how to contribute, see the [CONTRIBUTING](.github/CONTRIBUTING.md) file. | ||
For information about how to contribute, see the [CONTRIBUTING](.github/CONTRIBUTING.md) file. | ||
@@ -178,2 +178,2 @@ ## Development | ||
### [MIT Licensed](LICENSE) | ||
### [MIT Licensed](LICENSE.md) |
var React = require('react'), | ||
createClass = require('create-react-class'), | ||
DaysView = require('./DaysView'), | ||
@@ -8,3 +9,3 @@ MonthsView = require('./MonthsView'), | ||
var CalendarContainer = React.createClass({ | ||
var CalendarContainer = createClass({ | ||
viewComponents: { | ||
@@ -11,0 +12,0 @@ days: DaysView, |
'use strict'; | ||
var React = require('react'), | ||
createClass = require('create-react-class'), | ||
moment = require('moment'), | ||
@@ -9,3 +10,3 @@ onClickOutside = require('react-onclickoutside') | ||
var DOM = React.DOM; | ||
var DateTimePickerDays = onClickOutside( React.createClass({ | ||
var DateTimePickerDays = onClickOutside( createClass({ | ||
render: function() { | ||
@@ -21,5 +22,5 @@ var footer = this.renderFooter(), | ||
DOM.tr({ key: 'h' }, [ | ||
DOM.th({ key: 'p', className: 'rdtPrev' }, DOM.span({ onClick: this.props.subtractTime( 1, 'months' )}, '‹' )), | ||
DOM.th({ key: 'p', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'months' )}, DOM.span({}, '‹' )), | ||
DOM.th({ key: 's', className: 'rdtSwitch', onClick: this.props.showView( 'months' ), colSpan: 5, 'data-value': this.props.viewDate.month() }, locale.months( date ) + ' ' + date.year() ), | ||
DOM.th({ key: 'n', className: 'rdtNext' }, DOM.span({ onClick: this.props.addTime( 1, 'months' )}, '›' )) | ||
DOM.th({ key: 'n', className: 'rdtNext', onClick: this.props.addTime( 1, 'months' )}, DOM.span({}, '›' )) | ||
]), | ||
@@ -26,0 +27,0 @@ DOM.tr({ key: 'd'}, this.getDaysOfWeek( locale ).map( function( day, index ) { return DOM.th({ key: day + index, className: 'dow'}, day ); }) ) |
'use strict'; | ||
var React = require('react'), | ||
createClass = require('create-react-class'), | ||
onClickOutside = require('react-onclickoutside') | ||
@@ -8,9 +9,9 @@ ; | ||
var DOM = React.DOM; | ||
var DateTimePickerMonths = onClickOutside( React.createClass({ | ||
var DateTimePickerMonths = onClickOutside( createClass({ | ||
render: function() { | ||
return DOM.div({ className: 'rdtMonths' }, [ | ||
DOM.table({ key: 'a' }, DOM.thead( {}, DOM.tr( {}, [ | ||
DOM.th({ key: 'prev', className: 'rdtPrev' }, DOM.span({ onClick: this.props.subtractTime( 1, 'years' )}, '‹' )), | ||
DOM.th({ key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'years' )}, DOM.span({}, '‹' )), | ||
DOM.th({ key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2, 'data-value': this.props.viewDate.year() }, this.props.viewDate.year() ), | ||
DOM.th({ key: 'next', className: 'rdtNext' }, DOM.span({ onClick: this.props.addTime( 1, 'years' )}, '›' )) | ||
DOM.th({ key: 'next', className: 'rdtNext', onClick: this.props.addTime( 1, 'years' )}, DOM.span({}, '›' )) | ||
]))), | ||
@@ -17,0 +18,0 @@ DOM.table({ key: 'months' }, DOM.tbody({ key: 'b' }, this.renderMonths())) |
'use strict'; | ||
var React = require('react'), | ||
createClass = require('create-react-class'), | ||
assign = require('object-assign'), | ||
@@ -9,3 +10,3 @@ onClickOutside = require('react-onclickoutside') | ||
var DOM = React.DOM; | ||
var DateTimePickerTime = onClickOutside( React.createClass({ | ||
var DateTimePickerTime = onClickOutside( createClass({ | ||
getInitialState: function() { | ||
@@ -12,0 +13,0 @@ return this.calculateState( this.props ); |
'use strict'; | ||
var React = require('react'), | ||
createClass = require('create-react-class'), | ||
onClickOutside = require('react-onclickoutside') | ||
@@ -8,3 +9,3 @@ ; | ||
var DOM = React.DOM; | ||
var DateTimePickerYears = onClickOutside( React.createClass({ | ||
var DateTimePickerYears = onClickOutside( createClass({ | ||
render: function() { | ||
@@ -15,5 +16,5 @@ var year = parseInt( this.props.viewDate.year() / 10, 10 ) * 10; | ||
DOM.table({ key: 'a' }, DOM.thead({}, DOM.tr({}, [ | ||
DOM.th({ key: 'prev', className: 'rdtPrev' }, DOM.span({ onClick: this.props.subtractTime( 10, 'years' )}, '‹' )), | ||
DOM.th({ key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 10, 'years' )}, DOM.span({}, '‹' )), | ||
DOM.th({ key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2 }, year + '-' + ( year + 9 ) ), | ||
DOM.th({ key: 'next', className: 'rdtNext' }, DOM.span({ onClick: this.props.addTime( 10, 'years' )}, '›' )) | ||
DOM.th({ key: 'next', className: 'rdtNext', onClick: this.props.addTime( 10, 'years' )}, DOM.span({}, '›' )) | ||
]))), | ||
@@ -20,0 +21,0 @@ DOM.table({ key: 'years' }, DOM.tbody( {}, this.renderYears( year ))) |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances 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
505627
4481
7
32
+ Addedcreate-react-class@^15.5.2
+ Addedprop-types@^15.5.7
+ Addedprop-types@15.8.1(transitive)
+ Addedreact-is@16.13.1(transitive)