import React from "react"; import PropTypes from "prop-types"; import DateRangeSelect from "./DateRangeSelect"; export default class PageDates extends React.Component { constructor(props) { super(props); this.state = { has_dates: (props.starts_at ? true : false), all_day: !!props.all_day }; this.toggleAllDay = this.toggleAllDay.bind(this); this.toggleHasDates = this.toggleHasDates.bind(this); } toggleHasDates() { this.setState({ has_dates: !this.state.has_dates }); } toggleAllDay() { this.setState({ all_day: !this.state.all_day }); } timeToString(time) { return time.toTimeString().slice(0, 5); } render() { return (