Add time to ImageTagsSessionHeader

This commit is contained in:
Denis-Cosmin Nutiu 2024-11-19 22:02:29 +02:00
parent 69e1bf4d3c
commit d6328b9089
2 changed files with 13 additions and 1 deletions

View file

@ -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)"
}
/**

View file

@ -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)
}
}