Centralize time zone code in DataHelper

NewsManager should be a ClientApp, not a RouterApp
This commit is contained in:
zzz
2015-11-16 20:04:15 +00:00
parent 38a1a96db2
commit 6fb0692d57
11 changed files with 33 additions and 44 deletions

View File

@@ -12,7 +12,6 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.TreeMap;
import net.i2p.data.DataHelper;
@@ -189,9 +188,7 @@ public class EventLogHelper extends FormHandler {
SimpleDateFormat fmt = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
// the router sets the JVM time zone to UTC but saves the original here so we can get it
String systemTimeZone = _context.getProperty("i2p.systemTimeZone");
if (systemTimeZone != null)
fmt.setTimeZone(TimeZone.getTimeZone(systemTimeZone));
fmt.setTimeZone(DataHelper.getSystemTimeZone(_context));
List<Map.Entry<Long, String>> entries = new ArrayList<Map.Entry<Long, String>>(events.entrySet());
Collections.reverse(entries);