Add time to ImageTagsSessionHeader
This commit is contained in:
parent
69e1bf4d3c
commit
d6328b9089
2 changed files with 13 additions and 1 deletions
|
@ -65,7 +65,8 @@ class ImageTagsSessionHeader : HBox() {
|
|||
|
||||
// update header title
|
||||
val shortDate = dateTimeProvider.getTodayShortDate()
|
||||
this.title.text = "$shortDate ($numberOfImages Images)"
|
||||
val shortTime = dateTimeProvider.getTodayTime()
|
||||
this.title.text = "$shortDate - $shortTime - ($numberOfImages Images)"
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,8 @@ interface IDateTimeProvider {
|
|||
* Returns today's short date. For example: 09 April 2024
|
||||
*/
|
||||
fun getTodayShortDate(): String
|
||||
|
||||
fun getTodayTime(): String
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,4 +26,13 @@ class DateTimeProvider : IDateTimeProvider {
|
|||
val date = Date()
|
||||
return dateFormat.format(date)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns today's short time. Example: 15:30
|
||||
*/
|
||||
override fun getTodayTime(): String {
|
||||
val dateFormat: DateFormat = SimpleDateFormat("HH:mm", Locale.ENGLISH)
|
||||
val date = Date()
|
||||
return dateFormat.format(date)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue