IDEA-97350 Perforce integration doesn't account for time zone differences

This commit is contained in:
peter
2012-12-18 18:25:30 +01:00
parent af21ccb9e4
commit 2031efc332
2 changed files with 3 additions and 1 deletions
@@ -198,7 +198,7 @@ public class DateFormatUtil {
if (formatTime) {
long delta = currentTime - time;
if (delta <= HOUR) {
if (delta <= HOUR && delta >= 0) {
return CommonBundle.message("date.format.minutes.ago", (int)Math.rint(delta / (double)MINUTE));
}
}
@@ -66,6 +66,8 @@ public class DateFormatUtilTest extends TestCase {
doTestDateTime(DateFormatUtil.formatDateTime(DATE_FORMAT.parse("08.12.2004 15.00.00")), "08.12.2004 15.00.00");
doTestDateTime(DateFormatUtil.formatDateTime(DATE_FORMAT.parse("07.12.2004 15.00.00")), "07.12.2004 15.00.00");
doTestDateTime("Today " + DateFormatUtil.formatTime(DATE_FORMAT.parse("10.12.2004 19.00.00")), "10.12.2004 19.00.00");
Clock.setTime(2004, 0, 1, 15, 53);
doTestDateTime(DateFormatUtil.formatDateTime(DATE_FORMAT.parse("01.01.2003 15.53.00")), "01.01.2003 15.53.00");
doTestDateTime("Yesterday " + DateFormatUtil.formatTime(DATE_FORMAT.parse("31.12.2003 15.00.00")), "31.12.2003 15.00.00");