From 2a02f843771aaccea2cb497fdc40ae8ca384d498 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 18 Nov 2011 17:39:37 -0500
Subject: [PATCH] Added some flare to the console log
---
src/com/gitblit/utils/TimeUtils.java | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/com/gitblit/utils/TimeUtils.java b/src/com/gitblit/utils/TimeUtils.java
index 7ac1e79..ef8d428 100644
--- a/src/com/gitblit/utils/TimeUtils.java
+++ b/src/com/gitblit/utils/TimeUtils.java
@@ -253,11 +253,9 @@
int mins = 60;
if (!StringUtils.isEmpty(frequency)) {
try {
- String str;
+ String str = frequency.trim();
if (frequency.indexOf(' ') > -1) {
- str = frequency.substring(0, frequency.indexOf(' ')).trim();
- } else {
- str = frequency.trim();
+ str = str.substring(0, str.indexOf(' ')).trim();
}
mins = (int) Float.parseFloat(str);
} catch (NumberFormatException e) {
@@ -268,7 +266,7 @@
}
if (frequency.indexOf("day") > -1) {
// convert to minutes
- mins *= 24 * 60;
+ mins *= 1440;
} else if (frequency.indexOf("hour") > -1) {
// convert to minutes
mins *= 60;
--
Gitblit v1.9.1