Skip to content

Commit

Permalink
Fix Same time show order
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmx committed Jun 20, 2019
1 parent c76477c commit 71d6e5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/Home/day.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default ({ shows = [], images, index }) => (
<>
{shows.map(({ title, day, time, poster, artistes, slug }, i) => (
<Col key={`${title}-${day}-${time}`} xs={12} sm={6} md={4} lg={3}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<Link to={slug}>
<Day data-color={colors[index]} data-first={i === 0} data-last={i === shows.length - 1}>
{i === 0 ? day : ''}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const toFlatShows = shows => {
return flatShows;
};

const dateComparator = (a, b) => new Date(a.date) - new Date(b.date);
const dateComparator = (a, b) => new Date(a.date) - new Date(b.date) || a.title.localeCompare(b.title);

export const sortByDate = shows => shows.sort(dateComparator);

Expand Down

0 comments on commit 71d6e5e

Please sign in to comment.