From: Andy Scherzinger Date: Fri, 16 Oct 2015 12:47:12 +0000 (+0200) Subject: Merge branch 'fix_1192_date_time' of https://github.com/owncloud/android into materia... X-Git-Tag: beta-20151202~3^2~27 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/0e6920c8787c16791f737f28bad678f806c7e5c7?hp=8586416423ccffc7d779b0bb24a3e8b26e83ea2b Merge branch 'fix_1192_date_time' of https://github.com/owncloud/android into material_fab --- diff --git a/src/com/owncloud/android/utils/DisplayUtils.java b/src/com/owncloud/android/utils/DisplayUtils.java index 46c66737..99c465ec 100644 --- a/src/com/owncloud/android/utils/DisplayUtils.java +++ b/src/com/owncloud/android/utils/DisplayUtils.java @@ -214,8 +214,17 @@ public class DisplayUtils { dateString = DateUtils.getRelativeDateTimeString(c, time, minResolution, transitionResolution, flags); } } - - return dateString.toString().split(",")[0]; + + String[] parts = dateString.toString().split(","); + if (parts.length == 2) { + if (parts[1].contains(":") && !parts[0].contains(":")) { + return parts[0]; + } else if (parts[0].contains(":") && !parts[1].contains(":")) { + return parts[1]; + } + } + //dateString contains unexpected format. use localized, absolute date. + return DisplayUtils.unixTimeToHumanReadable(time); } /**