mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	refactor: use relativeTimeSpanString
Instead of manually formatting, use the relativeTimeSpanString function.
This commit is contained in:
		| @@ -493,11 +493,6 @@ private fun getAutomaticSyncGroup(syncPreferences: SyncPreferences): Preference. | ||||
|     val context = LocalContext.current | ||||
|     val syncIntervalPref = syncPreferences.syncInterval() | ||||
|     val lastSync by syncPreferences.syncLastSync().collectAsState() | ||||
|     val formattedLastSync = DateUtils.getRelativeTimeSpanString( | ||||
|         lastSync.toEpochMilli(), | ||||
|         System.currentTimeMillis(), | ||||
|         DateUtils.MINUTE_IN_MILLIS, | ||||
|     ) | ||||
|  | ||||
|     return Preference.PreferenceGroup( | ||||
|         title = stringResource(R.string.pref_sync_service_category), | ||||
| @@ -521,7 +516,7 @@ private fun getAutomaticSyncGroup(syncPreferences: SyncPreferences): Preference. | ||||
|                     true | ||||
|                 }, | ||||
|             ), | ||||
|             Preference.PreferenceItem.InfoPreference(stringResource(R.string.last_synchronization, formattedLastSync)), | ||||
|             Preference.PreferenceItem.InfoPreference(stringResource(R.string.last_synchronization, relativeTimeSpanString(lastSync.toEpochMilli()))), | ||||
|         ), | ||||
|     ) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user