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

Add date of birth field #42

Conversation

foojingyi
Copy link

Added Date Of Birth class and support for a date of birth field.
Resolves #7 .

FooJingYi added 7 commits October 1, 2020 02:35
* 'master' of https://github.com/AY2021S1-CS2103T-F13-3/tp:
  Update homepage for project website
  Update DG
  Fix bug in NameContainsKeywordsPredicateTest.java after adding Weight field
  Fix bug in Person class constructor
  Update more existing tests to include weight field
  Update existing tests to support new Weight field, Add 3 new tests for Weight class under WeightTest.java
  add weight field to person
* master:
  Update homepage for project website
  Update DG
  Fix bug in NameContainsKeywordsPredicateTest.java after adding Weight field
  Fix bug in Person class constructor
  Update more existing tests to include weight field
  Update existing tests to support new Weight field, Add 3 new tests for Weight class under WeightTest.java
  add weight field to person
Copy link

@wang-jun-hao wang-jun-hao left a comment

Choose a reason for hiding this comment

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

Some minor refactoring and changes to comments. Almost good to merge.

src/main/java/seedu/address/model/person/DateOfBirth.java Outdated Show resolved Hide resolved
Comment on lines +37 to +38
public static final String VALID_DOB_AMY = "14-02-1997";
public static final String VALID_DOB_BOB = "11-11-2001";

Choose a reason for hiding this comment

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

Perhaps it is better to name it VALID_DATE_OF_BIRTH_AMY and VALID_DATE_OF_BIRTH_BOB to keep it consistent with the current style, where the full class name is used instead of abbreviations?

Comment on lines +56 to +57
public static final String DOB_DESC_AMY = " " + PREFIX_DOB + VALID_DOB_AMY;
public static final String DOB_DESC_BOB = " " + PREFIX_DOB + VALID_DOB_BOB;

Choose a reason for hiding this comment

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

Perhaps it is better to name it DATE_OF_BIRTH_DESC_AMY and DATE_OF_BIRTH_DESC_BOB?

@@ -65,6 +70,7 @@

public static final String INVALID_IC_DESC = " " + PREFIX_IC + "A222223HH";
public static final String INVALID_NAME_DESC = " " + PREFIX_NAME + "James&"; // '&' not allowed in names
public static final String INVALID_DOB_DESC = " " + PREFIX_DOB + "31/12/95"; // '-' should be used instead of '/'

Choose a reason for hiding this comment

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

Maybe it is better to use the full class name for clarity?
A good case of invalid check since '/' is quite a common way of inputting dates.

Copy link

@wang-jun-hao wang-jun-hao left a comment

Choose a reason for hiding this comment

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

LGTM

@wang-jun-hao wang-jun-hao merged commit 0adac5a into AY2021S1-CS2103T-F13-3:master Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants