Skip to content

Commit

Permalink
Merge pull request #25 from persy97/master
Browse files Browse the repository at this point in the history
Add Display Data
  • Loading branch information
atyachari authored Oct 25, 2023
2 parents 61e7738 + b01b842 commit 2c8d97f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,11 @@ public void setSelected(boolean selected) {
public String toString() {
return mName;
}

public String getDisplayData() {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd_HHmmss");
Date date = format.parse(mName, new ParsePosition(0));
return mPath + new SimpleDateFormat("dd MMM, yyyy HH:mm:ss").format(date);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ public void selfieRecord_DisplayName() {
SelfieRecord selfieRecord = new SelfieRecord("", "20220101_000000");
assertEquals(selfieRecord.getDisplayName(), "01 Jan, 2022 00:00:00");
}

@Test
public void selfieRecord_DisplayData() {
SelfieRecord selfieRecord = new SelfieRecord("Test", "20220101_000000");
assertEquals(selfieRecord.getDisplayData(), "Test01 Jan, 2022 00:00:00");
assertEquals(selfieRecord.getDisplayName(), "01 Jan, 2022 00:00:00");
}

}

0 comments on commit 2c8d97f

Please sign in to comment.