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

Allow user to see the actual open and close time of tasks #73

Merged
merged 13 commits into from
Nov 3, 2016
Merged
2 changes: 1 addition & 1 deletion src/main/java/seedu/task/model/task/DateTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public String toString() {

if(value.isPresent()) {
DateTimeFormatter formatter =
DateTimeFormatter.ofLocalizedDateTime( FormatStyle.FULL )
DateTimeFormatter.ofLocalizedDateTime( FormatStyle.SHORT )
.withLocale( Locale.UK )
.withZone( ZoneId.systemDefault() );
return formatter.format( value.get() );
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/seedu/task/ui/TaskCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,27 @@ public class TaskCard extends UiPart{

@FXML
private Label closeTime;

//@@author A0153467Y
@FXML
private Label actualOpenTime;

@FXML
private Label actualCloseTime;

@FXML
private Label firstOpenBracket;

@FXML
private Label firstCloseBracket;

@FXML
private Label secondOpenBracket;

@FXML
private Label secondCloseBracket;
//@@author

@FXML
private VBox cardDetails;

Expand Down Expand Up @@ -62,6 +82,7 @@ public void initialize() {
setVisualFlags();
showExtendedInformation();
}

//@@author A0144939R
private void setCardDetails() {
name.setText(task.getName().taskName);
Expand All @@ -70,6 +91,15 @@ private void setCardDetails() {
openTime.setText(task.getOpenTime().toPrettyString());
closeTime.setText(task.getCloseTime().toPrettyString());

actualOpenTime.setText(task.getOpenTime().toString());
actualCloseTime.setText(task.getCloseTime().toString());

firstOpenBracket.setText("(");
firstCloseBracket.setText(")");

secondOpenBracket.setText("(");
secondCloseBracket.setText(")");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use String.format instead of splitting it into multiple Labels.
Reference: Java Documentation, Format specifiers


tagListPanel = TagListPanel.load(getPrimaryStage(), tagsListPlaceholder, task.getTags().getInternalList());
}
//@@author
Expand Down
10 changes: 8 additions & 2 deletions src/main/resources/view/TaskListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@
<HBox spacing="5" alignment="CENTER_LEFT">
<children>
<Label styleClass="cell_big_label" text="Start: "></Label>
<Label fx:id="openTime" styleClass="cell_big_label" text="\$openTime" />
<Label fx:id="actualOpenTime" styleClass="cell_big_label" text="\$actualOpenTime" />
<Label fx:id="firstOpenBracket" styleClass="cell_big_label" text="\$firstOpenBracket" />
<Label fx:id="openTime" styleClass="cell_big_label" text="\$openTime" />
<Label fx:id="firstCloseBracket" styleClass="cell_big_label" text="\$firstCloseBracket" />
</children>
</HBox>
<HBox spacing="5" alignment="CENTER_LEFT">
<children>
<Label styleClass="cell_big_label" text="End: "></Label>
<Label fx:id="closeTime" styleClass="cell_big_label" text="\$closeTime" />
<Label fx:id="actualCloseTime" styleClass="cell_big_label" text="\$actualCloseTime" />
<Label fx:id="secondOpenBracket" styleClass="cell_big_label" text="\$secondOpenBracket" />
<Label fx:id="closeTime" styleClass="cell_big_label" text="\$closeTime" />
<Label fx:id="secondCloseBracket" styleClass="cell_big_label" text="\$secondCloseBracket" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same thing here.

</children>
</HBox>
</children>
Expand Down