Skip to content

Commit

Permalink
Merge pull request #459 from SCCapstone/hotfix
Browse files Browse the repository at this point in the history
hotfix
  • Loading branch information
AaronKeys authored Apr 1, 2024
2 parents ac74eac + 21a7478 commit bc510d3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions FU.SPA/src/components/pages/CreatePost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default function CreatePost() {
} else {
setIsEnabled(false);
}
console.log(isEnabled);
}, [title, game, isEnabled]);

// Handles title state error
Expand Down Expand Up @@ -87,8 +86,8 @@ export default function CreatePost() {

// Handles end date state error
const handleEndDateChange = (e) => {
if (e.isAfter(dayjs().add(31, 'days'))) {
setEndDateError('Time cannot exceed 1 month');
if (e.isAfter(dayjs().add(24, 'hours'))) {
setEndDateError('Time cannot exceed 24 hours');
setEndTime(e);
} else if (e.isBefore(startTime)) {
setEndDateError('Time cannot be before start time');
Expand Down Expand Up @@ -234,7 +233,7 @@ export default function CreatePost() {
textField: {
fullWidth: true,
error:
endTime.isAfter(dayjs().add(31, 'days')) ||
endTime.isAfter(dayjs().add(24, 'hours')) ||
endTime.isBefore(startTime),
helperText: endDateError,
},
Expand Down Expand Up @@ -285,7 +284,7 @@ const GameSelector = ({ onChange }) => {
GameService.searchGames('').then((games) => setGameOptions(games));
GameService.searchGames('').then((games) => setGameOptions(games));
} catch (err) {
console.log(err);
console.error(err);
}
};
fetchGameOptions();
Expand Down

0 comments on commit bc510d3

Please sign in to comment.