aboutsummaryrefslogtreecommitdiff
path: root/taler-kotlin-common/src/main/java/net/taler/common
diff options
context:
space:
mode:
Diffstat (limited to 'taler-kotlin-common/src/main/java/net/taler/common')
-rw-r--r--taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt b/taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt
index ad9dab9..64d5656 100644
--- a/taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt
+++ b/taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt
@@ -22,6 +22,7 @@ import android.net.ConnectivityManager
import android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET
import android.os.Build.VERSION.SDK_INT
import android.text.format.DateUtils.DAY_IN_MILLIS
+import android.text.format.DateUtils.FORMAT_ABBREV_ALL
import android.text.format.DateUtils.FORMAT_ABBREV_MONTH
import android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE
import android.text.format.DateUtils.FORMAT_NO_YEAR
@@ -88,3 +89,8 @@ fun Long.toAbsoluteTime(context: Context): CharSequence {
val flags = FORMAT_SHOW_TIME or FORMAT_SHOW_DATE or FORMAT_SHOW_YEAR
return formatDateTime(context, this, flags)
}
+
+fun Long.toShortDate(context: Context): CharSequence {
+ val flags = FORMAT_SHOW_DATE or FORMAT_SHOW_YEAR or FORMAT_ABBREV_ALL
+ return formatDateTime(context, this, flags)
+}