Skip to content

Commit

Permalink
update UG for explaining date and time format
Browse files Browse the repository at this point in the history
update constraints for the year field
  • Loading branch information
dabzpengu committed Apr 14, 2024
1 parent 118d185 commit 07e2053
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
42 changes: 28 additions & 14 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,21 @@ contact management tasks done faster than traditional GUI apps.
**<span style="color:#8A15C5;">4 - Lowest Priority</span>** - 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

<div markdown="block" class="alert alert-info">
Expand Down Expand Up @@ -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`.<br/>* `dd` - refers to the day and the acceptable range is from **01** to **31**<br/> * `MM` - refers to the month and the acceptable range is from **01** to **12**<br/>* `yy` - refers to the year and accepts any **4-digit** numbers from **0001** to **9999**<br/> * `HH` - refers to the hour and the acceptable range is from **00** to **23**<br/> * `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. |

Original file line number Diff line number Diff line change
Expand Up @@ -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]$";
Expand Down

0 comments on commit 07e2053

Please sign in to comment.