DatePicker.js 2.0 KB

1
  1. var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _Module2=_interopRequireDefault(require("../lib/Module"));var _Types=_interopRequireDefault(require("../lib/Types"));var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\src\\modules\\DatePicker.js";var DatePicker=function(_Module){(0,_inherits2.default)(DatePicker,_Module);function DatePicker(props){var _this;(0,_classCallCheck2.default)(this,DatePicker);_this=(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(DatePicker).call(this,props));_this.state={chosenDate:new Date()};return _this;}(0,_createClass2.default)(DatePicker,[{key:"setDate",value:function setDate(newDate){this.setState({chosenDate:newDate});}},{key:"display",value:function display(){var _this2=this;var _ref=this.props.style||'',container=_ref.container;return _react.default.createElement(_reactNative.View,{style:container,__source:{fileName:_jsxFileName,lineNumber:19}},_react.default.createElement(_reactNative.DatePickerIOS,{date:this.state.chosenDate,onDateChange:function onDateChange(date){return _this2.setDate(date);},__source:{fileName:_jsxFileName,lineNumber:20}}));}}]);return DatePicker;}(_Module2.default);exports.default=DatePicker;DatePicker.Inputs={};