Added full date-time tooltip

This commit is contained in:
Abdelilah El Aissaoui 2021-12-06 23:02:14 +01:00
parent e23181d530
commit ed55ba2814
2 changed files with 10 additions and 1 deletions

View File

@ -33,3 +33,11 @@ fun Date.toSystemString(): String {
return sdf.format(this) return sdf.format(this)
} }
fun Date.toSystemDateTimeString(): String {
val systemLocale = System.getProperty("user.language")
val locale = Locale(systemLocale)
val sdf = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, locale)
return sdf.format(this)
}

View File

@ -145,12 +145,13 @@ fun Author(commit: RevCommit) {
authorIdent.`when`.toSmartSystemString() authorIdent.`when`.toSmartSystemString()
} }
Text( TooltipText(
text = date, text = date,
color = MaterialTheme.colors.secondaryTextColor, color = MaterialTheme.colors.secondaryTextColor,
maxLines = 1, maxLines = 1,
modifier = Modifier.padding(horizontal = 16.dp), modifier = Modifier.padding(horizontal = 16.dp),
fontSize = 12.sp, fontSize = 12.sp,
tooltipTitle = authorIdent.`when`.toSystemDateTimeString()
) )
} }