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 new file mode 100644 index 0000000..72869dd --- /dev/null +++ b/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/utils/date/DateTimeProvider.kt @@ -0,0 +1,27 @@ +package dev.nuculabs.imagetagger.ui.utils.date + +import java.text.DateFormat +import java.text.SimpleDateFormat +import java.util.* + +interface IDateTimeProvider { + /** + * Returns today's short date. For example: 09 April 2024 + */ + fun getTodayShortDate(): String +} + +/** + * Utilities for providing date and time related values. + */ +class DateTimeProvider : IDateTimeProvider { + + /** + * Returns today's short date. For example: 09 April 2024 + */ + override fun getTodayShortDate(): String { + val dateFormat: DateFormat = SimpleDateFormat("dd MMMM YYYY", Locale.ENGLISH) + val date = Date() + return dateFormat.format(date) + } +} \ No newline at end of file