Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gibson0918] IP #375

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
556af3f
Add Gradle support
May 24, 2020
d2246c4
Add Level 1. Greet, Echo, Exit feature
Gibson0918 Jan 31, 2023
28b9930
Level 2 Completed
Gibson0918 Jan 31, 2023
75b6c9e
Level 3 done
Gibson0918 Jan 31, 2023
27b9c65
level 4 completed
Gibson0918 Feb 1, 2023
a008a30
Update Duke.java
Gibson0918 Feb 1, 2023
7f54de7
Completed Duke's Automated Text UI testing
Gibson0918 Feb 1, 2023
f43cdd7
Level 5 Completed.
Gibson0918 Feb 1, 2023
7e981d9
Level 6 Completed
Gibson0918 Feb 1, 2023
ee4a824
Added Enumerations
Gibson0918 Feb 1, 2023
44bf9f2
Update Duke.java
Gibson0918 Feb 1, 2023
038d559
Delete unnecessary files
Gibson0918 Feb 1, 2023
cdbfde3
Level 7 Completed
Gibson0918 Feb 1, 2023
9e0df04
Level 8 Completed
Gibson0918 Feb 1, 2023
33c6108
Merge branch 'branch-Level-8'
Gibson0918 Feb 1, 2023
6b26a8e
Refactor Duke to use more OOP
Gibson0918 Feb 2, 2023
3893500
Merge remote-tracking branch 'upstream/add-gradle-support'
Gibson0918 Feb 2, 2023
a8d7d89
Merge remote-tracking branch 'origin/add-gradle-support'
Gibson0918 Feb 3, 2023
26a98f0
Fixed bugs related to datetime and organize duke into packages
Gibson0918 Feb 4, 2023
c722460
add Gradle to Duke
Gibson0918 Feb 4, 2023
dcb5baf
Added JUnit tests for Duke
Gibson0918 Feb 5, 2023
4dc52da
Merge branch 'master' of https://github.com/Gibson0918/ip
Gibson0918 Feb 6, 2023
1756cea
Release duke to the wild
Gibson0918 Feb 6, 2023
391e222
Added Java Docs to Duke
Gibson0918 Feb 7, 2023
ca66669
Added StringBuilder class to Duke
Gibson0918 Feb 7, 2023
fc417a2
Completed Level 9
Gibson0918 Feb 7, 2023
818d54e
Tweak Duke's code
Gibson0918 Feb 7, 2023
451fc56
Level 10 Completed
Gibson0918 Feb 8, 2023
6a11a02
Remove commented lines
Gibson0918 Feb 8, 2023
9b4f6d8
Added more Java Docs
Gibson0918 Feb 9, 2023
cbb24a9
Improve Duke's code quality
Gibson0918 Feb 10, 2023
cad9985
Update README.md
Gibson0918 Feb 13, 2023
486c91d
Add Update feature to Duke
Gibson0918 Feb 14, 2023
77e726e
Updated GUI and added set method to tasklist
Gibson0918 Feb 14, 2023
f94e91b
Added Assertions to Duke
Gibson0918 Feb 14, 2023
7d857d1
Merge pull request #2 from Gibson0918/branch-A-Assertions
Gibson0918 Feb 14, 2023
18c5321
Update README.md
Gibson0918 Feb 15, 2023
e2a6d89
Fixed some bugs relating to DateTime format and Duke exit command
Gibson0918 Feb 15, 2023
14367ac
Merge branch 'master' of https://github.com/Gibson0918/ip
Gibson0918 Feb 15, 2023
5954700
Added Ui image for docs
Gibson0918 Feb 15, 2023
b272b25
Clean up code for checkstyle
Gibson0918 Feb 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/main/java/Event.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Event extends Task {
protected String from;
protected String to;
protected LocalDateTime from;
protected LocalDateTime to;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps startDate and endDate would be better names

public Event(String description, String from, String to) {
super(description);
this.from = from;
this.to = to;
this.from = LocalDateTime.parse(from, DateTimeFormatter.ofPattern("yyyy-MM-dd HHmm"));
this.to = LocalDateTime.parse(to, DateTimeFormatter.ofPattern("yyyy-MM-dd HHmm"));
}

@Override
public String toString() {
return "[E]" + super.toString() + " (from: " + from + " to: " + to + ")";
return "[E]" + super.toString() + " (from: " + from.format(DateTimeFormatter.ofPattern("MMM dd yyyy HH:mm")) + " to: " + to.format(DateTimeFormatter.ofPattern("MMM dd yyyy HH:mm")) + ")";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this return statement could be indented better

}
}