Skip to content

Commit 5150875

Browse files
committed
fix: update birth date constraints to disallow future dates
1 parent 3a99975 commit 5150875

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

docs/UserGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ All NRIC fields (`ic`) follow the same 9-character alphanumeric rule.<br>
141141
| **`p`** | `PHONE_NUMBER` | - Must be a valid phone number (at least 3 digits and at most 20 digits, e.g., 999).<br> - Multiple patients can share the same phone number, as it is used only for contact purposes (e.g., children sharing their parent's number). |
142142
| **`e`** | `EMAIL` | - Must follow the format `local-part@domain` and adhere to these constraints:<br> 1. The `local-part` must only contain alphanumeric characters and these special characters: `+_.-`. It cannot start or end with a special character.<br> 2. The `domain` consists of labels separated by periods, where each label:<br> - Starts and ends with alphanumeric characters.<br> - May contain hyphens between alphanumeric characters.<br> - Ends with a label at least 2 characters long. |
143143
| **`ic`**| `NRIC` | - **9-character alphanumeric**: Starts with one of the following uppercase letters: `S`, `F`, `M`, `T`, or `G`, followed by 7 digits (0-9), and ends with an uppercase letter (A-Z). Example: `S1234567A`. |
144-
| **`b`** | `BIRTHDATE` | - Format: `dd-MM-yyyy` (e.g. `01-01-1990`). |
144+
| **`b`** | `BIRTHDATE` | - Format: `dd-MM-yyyy` (e.g. `01-01-1990`).<br> - Must not be a future date. |
145145
| **`a`** | `ADDRESS` | - No specific constraints. |
146146
| **`t`** | `TAG` | - Optional. <br/>- Can have multiple different tags (e.g. `t/chronic t/followup`). <br/>- Repeating the same tag (e.g. `t/chronic t/chronic`) has no effect — it will only be added once. <br/>- Tags must not contain spaces and must have at most 20 characters. For example, `t/needs checkup` is **not** allowed. Instead, use something like `t/needs_checkup` or `t/checkup`. |
147147

src/main/java/seedu/address/model/person/BirthDate.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
public class BirthDate implements Comparable<BirthDate> {
1515

1616
public static final String MESSAGE_CONSTRAINTS =
17-
"Birth date should be in the format dd-MM-yyyy and should be a valid date";
18-
public static final String DATE_IN_FUTURE_CONSTRAINTS = "Birth date should not be in the future";
17+
"Birth date should be in the format dd-MM-yyyy and should not be in the future.";
1918

2019
public final LocalDate value;
2120

0 commit comments

Comments
 (0)