package seedu.tasklist.ui;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.tasklist.model.task.ReadOnlyTask;

//@@author A0143355J
public class UpcomingTaskCard extends UiPart<Region> {

    private static final String FXML = "UpcomingTaskListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label name;
    @FXML
    private Label id;

    @FXML
    private Label startTime;
    @FXML
    private Label endTime;

    public UpcomingTaskCard(ReadOnlyTask task, int displayedIndex) {
        super(FXML);
        name.setText(task.getName().fullName);
        id.setText(displayedIndex + ". ");
    }
}

@@ -149,16 +149,261 @@
 Region;%0A
+import seedu.tasklist.model.task.DeadlineTask;%0Aimport seedu.tasklist.model.task.EventTask;%0Aimport seedu.tasklist.model.task.FloatingTask;%0Aimport seedu.tasklist.model.task.ReadOnlyDeadlineTask;%0Aimport seedu.tasklist.model.task.ReadOnlyEventTask;%0A
 import s
@@ -949,16 +949,561 @@
  %22. %22);%0A
+        String taskType = task.getType();%0A        switch (taskType) %7B%0A        case FloatingTask.TYPE:%0A            startTime.setVisible(false);%0A            endTime.setVisible(false);%0A            break;%0A        case DeadlineTask.TYPE:%0A            startTime.setText(%22Due: %22);%0A            endTime.setText(((ReadOnlyDeadlineTask) task).getTime());%0A            break;%0A        case EventTask.TYPE:%0A            startTime.setText(((ReadOnlyEventTask) task).getStartTime());%0A            endTime.setText(((ReadOnlyEventTask) task).getEndTime());%0A        %7D%0A
     %7D%0A%7D%0A

add time for DeadlineTask and EventTask