package seedu.whatnow.ui;

import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import seedu.whatnow.model.task.ReadOnlyTask;

public class TaskCard extends UiPart{

    private static final String FXML = "TaskListCard.fxml";
    private static final String INCOMPLETE = "";

    @FXML
    private HBox cardPane;
    @FXML
    private Label name;
    @FXML
    private Label taskDate;
    @FXML
    private Label id;
    @FXML
    private Label tags;
    @FXML
    private Label status;

    private ReadOnlyTask task;
    private int displayedIndex;

    public TaskCard(){

    }

    public static TaskCard load(ReadOnlyTask task, int displayedIndex){
        TaskCard card = new TaskCard();
        card.task = task;
        card.displayedIndex = displayedIndex;
        return UiPartLoader.loadUiPart(card);
    }

    @FXML
    public void initialize() {
        name.setText(task.getName().fullName);
        id.setText(displayedIndex + ". ");
        taskDate.setText(task.getTaskDate().fullDate);
        tags.setText(task.tagsString());
        if (task.getStatus().equals("incomplete")) {
            status.setText(INCOMPLETE);
        } else {
            status.setText(task.getStatus());
        }
    }

    public HBox getLayout() {
        return cardPane;
    }

    @Override
    public void setNode(Node node) {
        cardPane = (HBox)node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }
}

package seedu.whatnow.ui;

import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import seedu.whatnow.model.task.ReadOnlyTask;

public class TaskCard extends UiPart{

    private static final String FXML = "TaskListCard.fxml";
    private static final String INCOMPLETE = "";

    @FXML
    private HBox cardPane;
    @FXML
    private Label name;
    @FXML
    private Label taskDate;
    @FXML
    private Label id;
    @FXML
    private Label tags;
    @FXML
    private Label status;

    private ReadOnlyTask task;
    private int displayedIndex;

    public TaskCard(){

    }

    public static TaskCard load(ReadOnlyTask task, int displayedIndex){
        TaskCard card = new TaskCard();
        card.task = task;
        card.displayedIndex = displayedIndex;
        return UiPartLoader.loadUiPart(card);
    }

    @FXML
    public void initialize() {
        name.setText(task.getName().fullName);
        id.setText(displayedIndex + ". ");
        if(task.getTaskDate() != null){
        	taskDate.setText(task.getTaskDate().fullDate);
        }
        tags.setText(task.tagsString());
        if (task.getStatus().equals("incomplete")) {
            status.setText(INCOMPLETE);
        } else {
            status.setText(task.getStatus());
        }
    }

    public HBox getLayout() {
        return cardPane;
    }

    @Override
    public void setNode(Node node) {
        cardPane = (HBox)node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }
}

Update TaskCard.java file - Check whether there is a date entered