Skip to content

Commit

Permalink
Merge pull request AY2324S2-CS2103T-T08-1#72 from laney0808/fix-non-c…
Browse files Browse the repository at this point in the history
…ompilling-code

Fix DateOfBirth constructor
  • Loading branch information
NatLeong authored Mar 21, 2024
2 parents 4fcc8f8 + 723ce73 commit 76abd3a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/seedu/address/model/person/DateOfBirth.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class DateOfBirth {
* @param dateOfBirth A valid date of birth.
*/
public DateOfBirth(String dateOfBirth) {
if (!isValidDateOfBirth(dateOfBirth)) {
throw new IllegalArgumentException(MESSAGE_CONSTRAINTS);
}
this.dateOfBirth = LocalDate.parse(dateOfBirth);
}

Expand Down

0 comments on commit 76abd3a

Please sign in to comment.