Skip to content

Commit

Permalink
Fix temporal bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yisiox committed Feb 18, 2024
1 parent 64f4b9f commit a2a2f91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/earl/tasks/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Event(String description, String from, String to)
taskType = TaskType.EVENT;
this.from = DateTimeParser.parse(from);
this.to = DateTimeParser.parse(to);
if (this.from.isAfter(this.to)) {
if (this.from.isAfter(this.to) || this.from.isEqual(this.to)) {
throw new TimeException();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/earl/util/parsers/InputParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static Handler parse(String input) {
try {
// all valid input is expected to be of the format
// <command> [<arg1>, <arg2>, ...]
String[] data = input.split("\\s+", 2);
String[] data = input.trim().split("\\s+", 2);
assert data.length > 0;
String command = data[0].toUpperCase();
if (command.isEmpty()) {
Expand Down

0 comments on commit a2a2f91

Please sign in to comment.