Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change date to not accept future dates #191

Merged
merged 3 commits into from
Apr 11, 2019

Conversation

eugeneyl
Copy link

  • For spend and edit commands, users can no longer add in future date as the date field.

@@ -54,6 +55,9 @@ public static boolean isValidDate(String test) {
int month = Integer.parseInt(parsedDate[1]);
int day = Integer.parseInt(parsedDate[0]);
LocalDate date = LocalDate.of(year, month, day);
if (date.isAfter(LocalDate.now())) {
return false;
}
} catch (Exception e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LocalDate has a isAfter method defined, so probably no need to write another method below

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not add that method so i did not change it or use it. I think @geezlouisee added it because it is used in the summary methods.

@kjiaxuan
Copy link

Need to change TypicalRecords' GIFT's date to a valid date (i think previously should be 2029)
Change it to a date where its still the latest among the other ABCDEFG records (cos sortcommandtest has some test where records are arranged by date)

need to change default date in RecordBuilder too

@eugeneyl eugeneyl merged commit 1dd10a1 into CS2103-AY1819S2-W17-3:master Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants