forked from nus-cs2103-AY1920S1/addressbook-level3
/
UpcomingTaskCard.java
39 lines (31 loc) · 1.02 KB
/
UpcomingTaskCard.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package seedu.address.ui.card;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.Region;
import seedu.address.model.tasks.TaskSource;
import seedu.address.ui.UiPart;
//@@author Kyzure
/**
* An UI component that displays information of a {@code Event}.
*/
public class UpcomingTaskCard extends UiPart<Region> {
private static final String FXML = "UpcomingTaskCard.fxml";
@FXML
private Label upcomingTaskName;
@FXML
private Label upcomingWeekDay;
@FXML
private Label upcomingDay;
/**
* Constructor for the UpcomingTaskCard, which displays the information of a particular task.
*
* @param task The given event.
*/
public UpcomingTaskCard(TaskSource task) {
super(FXML);
upcomingTaskName.setText(task.getDescription());
upcomingWeekDay.setText(task.getDueDate().getEnglishWeekDay());
upcomingDay.setText(String.valueOf(task.getDueDate().getDay()));
upcomingTaskName.setMinHeight(Region.USE_PREF_SIZE);
}
}