Updated DateInput to be clearable

This commit is contained in:
Alejandro Celaya
2018-08-09 20:13:46 +02:00
parent 6f38538dea
commit 3821735a89
4 changed files with 23 additions and 3 deletions

View File

@@ -48,6 +48,7 @@ export class CreateShortUrl extends React.Component {
selected={this.state[id]}
placeholderText={placeholder}
onChange={date => this.setState({ [id]: date })}
isClearable
{...props}
/>;
const formatDate = date => isNil(date) ? date : date.format();

View File

@@ -150,6 +150,7 @@ export class ShortUrlsVisits extends React.Component {
<DateInput
selected={this.state.startDate}
placeholderText="Since"
isClearable
onChange={date => this.setState({ startDate: date }, () => this.loadVisits())}
/>
</div>
@@ -157,6 +158,7 @@ export class ShortUrlsVisits extends React.Component {
<DateInput
selected={this.state.endDate}
placeholderText="Until"
isClearable
onChange={date => this.setState({ endDate: date }, () => this.loadVisits())}
className="short-url-visits__date-input"
/>