Skip to content

Commit

Permalink
Merge pull request #63 from CS2103AUG2016-W10-C3/TaskView_beautify
Browse files Browse the repository at this point in the history
Slight Improvement to UI of TaskCard
  • Loading branch information
YesYouKenSpace authored Oct 25, 2016
2 parents 9c60b47 + 8bc05f3 commit b0e8c0f
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions src/main/java/seedu/address/model/task/ReadOnlyTask.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package seedu.address.model.task;

import java.time.format.DateTimeFormatter;
import java.util.Optional;

import seedu.address.model.tag.UniqueTagList;
Expand Down Expand Up @@ -81,17 +82,31 @@ default String getAsText() {
*/
default String getAsHTML() {
final StringBuilder builder = new StringBuilder();
builder.append("<html> <body>")
builder.append("<html>")
.append("<body>")
.append("<h1>" + getName() + "</h1>")
.append("<br> Time: ")
.append(getTime())
.append("<br> Description: ")
.append(getDescription())
.append("<br> Location: ")
.append(getLocation())
.append("<br> Tags: ");
.append("<h3> Date: ");
if(getTime().isPresent()){
builder.append(getTime().get().getStartDate().toLocalDate().format(DateTimeFormatter.ofPattern("d MMM uuuu")));
}
builder.append("</h3>")
.append("<h3> Time: ");
if(getTaskType()==TaskType.DEADLINE){
builder.append(getTime().get().getStartDate().toLocalTime());
}else if(getTaskType()==TaskType.TIMERANGE){
builder.append(getTime().get().getStartDate().toLocalTime())
.append(" ~ ")
.append(getTime().get().getEndDate().get().toLocalTime());
}
builder.append("</h3>")
.append("<h3> Description: </h3>")
.append("<p>" + getDescription()+ "</p>")
.append("<h3> Location: </h3>")
.append("<p>" + getLocation()+ "</p>")
.append("<h3> Tags: ");
getTags().forEach(builder::append);
builder.append("</body> </html>");
builder.append("</h3>")
.append("</body> </html>");
return builder.toString();
}

Expand Down

0 comments on commit b0e8c0f

Please sign in to comment.