mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-18 23:17:28 +01:00
Use relative time in ChapterHolder (#5719)
* Use relative time in ChapterHolder Similar to how J2K does it * Use custom implementation for relative time * Changes based on review comments
This commit is contained in:
@@ -182,6 +182,7 @@ object PreferenceKeys {
|
||||
|
||||
const val libraryDisplayMode = "pref_display_mode_library"
|
||||
|
||||
const val relativeTime: String = "relative_time"
|
||||
const val dateFormat = "app_date_format"
|
||||
|
||||
const val defaultCategory = "default_category"
|
||||
|
||||
@@ -208,6 +208,8 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun backupsDirectory() = flowPrefs.getString(Keys.backupDirectory, defaultBackupDir.toString())
|
||||
|
||||
fun relativeTime() = flowPrefs.getInt(Keys.relativeTime, 7)
|
||||
|
||||
fun dateFormat(format: String = flowPrefs.getString(Keys.dateFormat, "").get()): DateFormat = when (format) {
|
||||
"" -> DateFormat.getDateInstance(DateFormat.SHORT)
|
||||
else -> SimpleDateFormat(format, Locale.getDefault())
|
||||
|
||||
Reference in New Issue
Block a user