Skip to content

Commit

Permalink
Prevent going past today
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonNoad committed Jun 6, 2019
1 parent cadfebf commit 4475b2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/reducers/moment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export const updateMomentFactory = (getTodayMoment) => (state, goto) => {
return getTodayMoment();

case 'next-day':
if (state.isSame(getTodayMoment(), 'day')) {
return state;
}

return Moment(state).add(1, 'days');

case 'prev-day':
Expand Down

0 comments on commit 4475b2c

Please sign in to comment.