diff --git a/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/controls/ImageTagsSessionHeader.kt b/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/controls/ImageTagsSessionHeader.kt index b16f232..9d5dd2f 100644 --- a/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/controls/ImageTagsSessionHeader.kt +++ b/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/controls/ImageTagsSessionHeader.kt @@ -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)" } /** diff --git a/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/utils/date/DateTimeProvider.kt b/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/utils/date/DateTimeProvider.kt index 72869dd..9ab867c 100644 --- a/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/utils/date/DateTimeProvider.kt +++ b/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/utils/date/DateTimeProvider.kt @@ -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) + } } \ No newline at end of file