diff --git a/src/visits/ShortUrlVisits.js b/src/visits/ShortUrlVisits.js
index 42ec802f..cf0c09f9 100644
--- a/src/visits/ShortUrlVisits.js
+++ b/src/visits/ShortUrlVisits.js
@@ -110,7 +110,7 @@ export class ShortUrlsVisitsComponent extends React.Component {
return (
-
+
@@ -119,6 +119,7 @@ export class ShortUrlsVisitsComponent extends React.Component {
selected={this.state.startDate}
placeholderText="Since"
isClearable
+ maxDate={this.state.endDate}
onChange={(date) => this.setState({ startDate: date }, () => this.loadVisits())}
/>
@@ -128,6 +129,7 @@ export class ShortUrlsVisitsComponent extends React.Component {
placeholderText="Until"
isClearable
className="short-url-visits__date-input"
+ minDate={this.state.startDate}
onChange={(date) => this.setState({ endDate: date }, () => this.loadVisits())}
/>
diff --git a/src/visits/VisitsHeader.js b/src/visits/VisitsHeader.js
index cb932409..db0d3e5e 100644
--- a/src/visits/VisitsHeader.js
+++ b/src/visits/VisitsHeader.js
@@ -5,14 +5,17 @@ import PropTypes from 'prop-types';
import ExternalLink from '../utils/ExternalLink';
import './VisitsHeader.scss';
import { shortUrlDetailType } from './reducers/shortUrlDetail';
+import { shortUrlVisitsType } from './reducers/shortUrlVisits';
const propTypes = {
- shortUrlDetail: shortUrlDetailType,
+ shortUrlDetail: shortUrlDetailType.isRequired,
+ shortUrlVisits: shortUrlVisitsType.isRequired,
shortLink: PropTypes.string,
};
-export function VisitsHeader({ shortUrlDetail, shortLink }) {
+export function VisitsHeader({ shortUrlDetail, shortUrlVisits, shortLink }) {
const { shortUrl, loading } = shortUrlDetail;
+ const { visits } = shortUrlVisits;
const renderDate = () => (
{shortUrl.dateCreated}
@@ -26,8 +29,7 @@ export function VisitsHeader({ shortUrlDetail, shortLink }) {