Skip to content

Commit

Permalink
Merge pull request #109 from McNaBry/update-jobapp-display
Browse files Browse the repository at this point in the history
Update job application UI display
  • Loading branch information
McNaBry authored Nov 2, 2023
2 parents adcaff2 + 25b0cb6 commit df7495d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package seedu.address.model.jobapplication;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Locale;

import seedu.address.commons.exceptions.IllegalValueException;

Expand All @@ -14,6 +16,12 @@ public class LastUpdatedTime implements Comparable<LastUpdatedTime> {
private static final String INVALID_FORMAT_MESSAGE = "The given last modified datetime is invalid: %s\n Delete "
+ "the last updated time section to reset the last updated time.";

private static final DateTimeFormatter displayFormat =
DateTimeFormatter.ofPattern(
"dd-MM-yyyy h:mma",
Locale.ENGLISH
);

public final LocalDateTime lastUpdatedTime;

/**
Expand Down Expand Up @@ -44,6 +52,10 @@ public static LastUpdatedTime generateLastUpdatedTime(String test) throws Illega
}
}

public String toDisplayString() {
return lastUpdatedTime.format(displayFormat);
}

@Override
public String toString() {
return lastUpdatedTime.toString();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/ui/ApplicationCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public ApplicationCard(JobApplication application, int displayedIndex) {
linkedParentOrganization.setText(application.getOrgName().fullName);
title.setText(application.getJobTitle().title);
status.setText(application.getStatus().toString());
deadline.setText(application.getDeadline().toString());
deadline.setText("Deadline: " + application.getDeadline().toString());
stage.setText(application.getApplicationStage().toString());
lastUpdatedTime.setText(application.getLastUpdatedTime().toString());
lastUpdatedTime.setText("Last Updated: " + application.getLastUpdatedTime().toDisplayString());
setVboxInnerLabelText(
description, () -> application.getJobDescription().map(JobDescription::toString).orElse(null));
}
Expand Down

0 comments on commit df7495d

Please sign in to comment.