UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

30 lines 871 B
import React from 'react'; import createClass from 'create-react-class'; import { DateSelect } from '../../../index'; import timemachine from 'timemachine'; timemachine.config({ dateString: 'December 25, 2018 13:12:59' }); export default createClass({ getInitialState: function getInitialState() { return { selectedDate: null }; }, handleSelectDate: function handleSelectDate(date) { this.setState({ selectedDate: date }); }, render: function render() { var selectedDate = this.state.selectedDate; return /*#__PURE__*/React.createElement("section", { style: { maxWidth: 400 } }, /*#__PURE__*/React.createElement(DateSelect, { selectedDays: selectedDate, onSelectDate: this.handleSelectDate }), "selected date:", ' ', selectedDate && selectedDate.toLocaleDateString('en-US')); } });