mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-10-29 11:47:01 +00:00
ModelUtil.getTimeFromLong() remove seconds
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
This commit is contained in:
parent
141893368e
commit
a933b55545
@ -51,13 +51,12 @@ public final class ModelUtil {
|
||||
* Returns a formatted String from time.
|
||||
*
|
||||
* @param diff the amount of elapsed time.
|
||||
* @return the formatte String.
|
||||
* @return the formatted String.
|
||||
*/
|
||||
public static String getTimeFromLong(long diff) {
|
||||
final String DAYS = Res.getString("time.days");
|
||||
final String HOURS = Res.getString("time.hours");
|
||||
final String MINUTES = Res.getString("time.minutes");
|
||||
final String SECONDS = Res.getString("time.seconds");
|
||||
final String LESS_THAN_ONE_MINUTE = Res.getString("time.less.than.one.minute");
|
||||
|
||||
final long MS_IN_A_DAY = 1000 * 60 * 60 * 24;
|
||||
@ -68,6 +67,9 @@ public final class ModelUtil {
|
||||
long numHours = diff / MS_IN_AN_HOUR;
|
||||
diff = diff % MS_IN_AN_HOUR;
|
||||
long numMinutes = diff / MS_IN_A_MINUTE;
|
||||
if (numMinutes == 0) {
|
||||
return LESS_THAN_ONE_MINUTE;
|
||||
}
|
||||
|
||||
StringBuilder buf = new StringBuilder();
|
||||
|
||||
@ -79,18 +81,9 @@ public final class ModelUtil {
|
||||
buf.append(numHours).append(" ").append(HOURS).append(", ");
|
||||
}
|
||||
|
||||
if (numMinutes > 0) {
|
||||
buf.append(numMinutes).append(" ").append(MINUTES);
|
||||
}
|
||||
|
||||
//buf.append(numSeconds + " " + SECONDS);
|
||||
buf.append(numMinutes).append(" ").append(MINUTES);
|
||||
|
||||
String result = buf.toString();
|
||||
|
||||
if (numMinutes < 1) {
|
||||
result = LESS_THAN_ONE_MINUTE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -922,7 +922,6 @@ title.certificate = Certificate
|
||||
time.days = d
|
||||
time.hours = h
|
||||
time.minutes = min
|
||||
time.seconds = sec
|
||||
time.since = since
|
||||
time.less.than.one.minute = less than 1 minute
|
||||
|
||||
|
||||
@ -921,7 +921,6 @@ title.certificate = Certificaat
|
||||
time.days = d
|
||||
time.hours = h
|
||||
time.minutes = min
|
||||
time.seconds = sec
|
||||
time.since = sinds
|
||||
time.less.than.one.minute = minder dan 1 minuut
|
||||
|
||||
|
||||
@ -922,7 +922,6 @@ title.certificate = Сертификат
|
||||
time.days = д
|
||||
time.hours = ч
|
||||
time.minutes = мин
|
||||
time.seconds = с
|
||||
time.since = с
|
||||
time.less.than.one.minute = меньше 1 минуты
|
||||
|
||||
|
||||
@ -922,7 +922,6 @@ title.certificate = 证书
|
||||
time.days = 天
|
||||
time.hours = 小时
|
||||
time.minutes = 分钟
|
||||
time.seconds = 秒
|
||||
time.since = 自从
|
||||
time.less.than.one.minute = 少于 1 分钟
|
||||
|
||||
|
||||
@ -144,7 +144,6 @@ title.number.of.conversations.found = # of conversations found:
|
||||
time.days = d
|
||||
time.hours = h
|
||||
time.minutes = min
|
||||
time.seconds = sec
|
||||
time.since = since
|
||||
time.less.than.one.minute = less than 1 minute
|
||||
|
||||
|
||||
@ -144,7 +144,6 @@ title.number.of.conversations.found = # de conversaciones encontradas:
|
||||
time.days = d
|
||||
time.hours = h
|
||||
time.minutes = min
|
||||
time.seconds = seg
|
||||
time.since = desde
|
||||
time.less.than.one.minute = menos de 1 minuto
|
||||
|
||||
|
||||
@ -144,7 +144,6 @@ title.number.of.conversations.found = # de conversações encontradas:
|
||||
time.days = d
|
||||
time.hours = h
|
||||
time.minutes = min
|
||||
time.seconds = seg
|
||||
time.since = desde
|
||||
time.less.than.one.minute = menos do que 1 minuto
|
||||
|
||||
|
||||
@ -144,7 +144,6 @@ title.number.of.conversations.found = # количество найденных
|
||||
time.days = д
|
||||
time.hours = ч
|
||||
time.minutes = мин
|
||||
time.seconds = сек
|
||||
time.since = начиная
|
||||
time.less.than.one.minute = меньше чем 1 минута
|
||||
|
||||
|
||||
@ -144,7 +144,6 @@ title.number.of.conversations.found = # 的对话已找到:
|
||||
time.days = 天
|
||||
time.hours = 时
|
||||
time.minutes = 分
|
||||
time.seconds = 秒
|
||||
time.since = 自
|
||||
time.less.than.one.minute = 小于 1 分钟
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user