Skip to content

Commit

Permalink
Edited UserGuide
Browse files Browse the repository at this point in the history
  • Loading branch information
heekit73098 committed Feb 28, 2022
1 parent 80f7f49 commit aa98266
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Total number of tasks now: 1
### `deadline` - Add a new Deadline task

The deadline should have the format of YYYY-MM-DD for the date and HH:mm for the time
Note that for all single digits (in Months, Day, Hour or Time), there should be a preceding 0 to make up the 2 digits.

Example of usage:

Expand All @@ -58,6 +59,8 @@ Total number of tasks now: 2

The Event task takes in two dates and times, one for the start and one for the end.
Format for both dates is YYYY-MM-DD and format for both times is HH:mm
Note that for all single digits (in Months, Day, Hour or Time), there should be a preceding 0 to make up the 2 digits.


Example of usage:

Expand Down
7 changes: 7 additions & 0 deletions src/duke/helper/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,12 @@ public void parseEvent() throws DukeException {
}catch (DateTimeParseException e) {
throw new DukeException("Invalid Date/Time format");
}
if (startDate.isAfter(endDate)) {
throw new DukeException("Start Date after End Date");
}else if (startDate.isEqual(endDate)) {
if (startTime.isAfter(endTime)) {
throw new DukeException("Start Time after End Time");
}
}
}
}

0 comments on commit aa98266

Please sign in to comment.