Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/sunlabs/brazil/util/http/HttpUtil.java

Issue 8961044: android: brazil StringIndexOutOfBoundsException fix (Closed)
Patch Set: android: brazil StringIndexOutOfBoundsException fix Created Nov. 27, 2012, 1:02 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sunlabs/brazil/util/http/HttpUtil.java
===================================================================
--- a/src/sunlabs/brazil/util/http/HttpUtil.java
+++ b/src/sunlabs/brazil/util/http/HttpUtil.java
@@ -26,6 +26,9 @@
*
* Version Histories:
*
+ * unversioned 12/11/27-15:37:00 (Andrey Novikov)
+ * fixed StringIndexOutOfBoundsException in formatTime(long time)
+ *
* 2.3 04/11/30-15:19:46 (suhler)
* fixed sccs version string
*
@@ -291,7 +294,11 @@
public static String
formatTime(long time)
{
- return dateFormat.format(new Date(time)).substring(0, 29);
+ String date = dateFormat.format(new Date(time));
+ int plus = date.indexOf('+');
+ if (plus > 0)
+ date = date.substring(0, plus);
+ return date;
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld