From 07e2053f611011eef63bc4e4c34412a0df49e304 Mon Sep 17 00:00:00 2001 From: dabzpengu <97381253+dabzpengu@users.noreply.github.com> Date: Sun, 14 Apr 2024 15:38:17 +0800 Subject: [PATCH] update UG for explaining date and time format update constraints for the year field --- docs/UserGuide.md | 42 ++++++++++++------- .../address/model/person/InterviewTime.java | 2 +- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index ebbcffca8bb..1a9bafd5f50 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -67,7 +67,21 @@ contact management tasks done faster than traditional GUI apps. **4 - Lowest Priority** - This is the lowest priority. -------------------------------------------------------------------------------------------------------------------- +## Date and Time +> Your CCBot uses date and time to better help you manage your interviews. This section contains all the details on how +> your CCBot interprets date and time. + +* ### Format : `ddMMyyyyHHmm` + * `dd` - refers to the day and the acceptable range is from **01** to **31** + * `MM` - refers to the month and the acceptable range is from **01** to **12** + * `yy` - refers to the year and accepts any **4-digit** numbers from **0001** to **9999** + * `HH` - refers to the hour and the acceptable range is from **00** to **23** + * `mm` - refers to the minutes and the acceptable range is from **00** to **59** +* ### Examples: + * `121220221400` is interpreted as **December 12, 2022 4:00 PM** + * `010100010000` is interpreted as **January 01, 0001 12:00 AM** +-------------------------------------------------------------------------------------------------------------------- ## Features
@@ -402,18 +416,18 @@ This value cannot be modified or added by the `edit` or `add` commands. | **jd/** | The job difficulty (only for `sort` command) | ## Constraints Summary -| Field | Constraint | -|----------------------|----------------------------------------------------------------------------------------------------------| -| `COMPANY_NAME` | Should be less than 100 characters, and it should not be blank. | -| `NAME` | Should only contain alphanumeric characters and spaces, and it should not be blank. | -| `PHONE_NUMBER` | Should only contain numbers, and it should be at least 3 digits long. | -| `EMAIL` | Should be a valid email address. | -| `ADDRESS` | Can take any values, and it should not be blank. | -| `SALARY` | Should only contain numbers, with range [0, 2147483647] or two pure digital numbers with '-' in between. Both digital numbers should be within the range [0, 2147483647]. | -| `PROGRAMMING_LANGUAGE` | Should be alphanumeric and may contain some special characters (+ and #), and must be less than 50 characters. | -| `TAG` | Should be alphanumeric. | -| `PRIORITY` | Should be a number between 0 and 4. | -| `INTERVIEW_TIME` | Should be in the format `ddMMyyyyHHmm`. | -| `INFO` | Can take any values, and it should not be blank. | -| `EDUCATION` | Should only contain alphanumeric characters and spaces, and it should not be blank. | +| Field | Constraint | +|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `COMPANY_NAME` | Should be less than 100 characters, and it should not be blank. | +| `NAME` | Should only contain alphanumeric characters and spaces, and it should not be blank. | +| `PHONE_NUMBER` | Should only contain numbers, and it should be at least 3 digits long. | +| `EMAIL` | Should be a valid email address. | +| `ADDRESS` | Can take any values, and it should not be blank. | +| `SALARY` | Should only contain numbers, with range [0, 2147483647] or two pure digital numbers with '-' in between. Both digital numbers should be within the range [0, 2147483647]. | +| `PROGRAMMING_LANGUAGE` | Should be alphanumeric and may contain some special characters (+ and #), and must be less than 50 characters. | +| `TAG` | Should be alphanumeric. | +| `PRIORITY` | Should be a number between 0 and 4. | +| `INTERVIEW_TIME` | Should be in the format `ddMMyyyyHHmm`.
* `dd` - refers to the day and the acceptable range is from **01** to **31**
* `MM` - refers to the month and the acceptable range is from **01** to **12**
* `yy` - refers to the year and accepts any **4-digit** numbers from **0001** to **9999**
* `HH` - refers to the hour and the acceptable range is from **00** to **23**
* `mm` - refers to the minutes and the acceptable range is from **00** to **59** | +| `INFO` | Can take any values, and it should not be blank. | +| `EDUCATION` | Should only contain alphanumeric characters and spaces, and it should not be blank. | diff --git a/src/main/java/seedu/address/model/person/InterviewTime.java b/src/main/java/seedu/address/model/person/InterviewTime.java index dd64216896b..ca80eae8768 100644 --- a/src/main/java/seedu/address/model/person/InterviewTime.java +++ b/src/main/java/seedu/address/model/person/InterviewTime.java @@ -15,7 +15,7 @@ public class InterviewTime { public static final String MESSAGE_CONSTRAINTS = "Error thrown, date and time format may be wrong. Check UG."; - public static final String REGEX_YYYY = "\\d{4}"; + public static final String REGEX_YYYY = "\"([1-9]\\\\d{3}|0\\\\d{3})\""; public static final String REGEX_DD = "(0[1-9]|[1-2][0-9]|3[01])"; public static final String REGEX_MM = "(0[1-9]|1[0-2])"; public static final String REGEX_HHMM = "^([0-1][0-9]|2[0-3])[0-5][0-9]$";