UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

31 lines (30 loc) 928 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() { return { selectedDate: null, }; }, handleSelectDate(date) { this.setState({ selectedDate: date, }); }, render() { const { selectedDate } = this.state; return (React.createElement("section", null, React.createElement(DateSelect, { isFontSizeRelative: true, style: { width: 600, height: 400, }, selectedDays: selectedDate, onSelectDate: this.handleSelectDate }), "selected date:", ' ', selectedDate && selectedDate.toLocaleDateString('en-US'))); }, });