manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1838010 - in /manifoldcf/trunk/framework: crawler-ui/src/main/webapp/ ui-core/src/main/java/org/apache/manifoldcf/ui/util/
Date Tue, 14 Aug 2018 12:03:05 GMT
Author: kwright
Date: Tue Aug 14 12:03:04 2018
New Revision: 1838010

URL: http://svn.apache.org/viewvc?rev=1838010&view=rev
Log:
All times in the UI are now reported in the browser timezone, to avoid confusion.

Modified:
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/documentstatus.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/simplereport.jsp
    manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Formatter.java

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/documentstatus.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/documentstatus.jsp?rev=1838010&r1=1838009&r2=1838010&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/documentstatus.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/documentstatus.jsp Tue Aug 14 12:03:04
2018
@@ -23,6 +23,17 @@
 %>
 
 <%
+final String clientTimezoneString = variableContext.getParameter("client_timezone");
+final TimeZone clientTimezone;
+if (clientTimezoneString == null || clientTimezoneString.length() == 0)
+{
+  clientTimezone = TimeZone.getDefault();
+}
+else
+{
+  clientTimezone = TimeZone.getTimeZone(clientTimezoneString);
+}
+
 try
 {
   // Check if authorized
@@ -470,7 +481,7 @@ try
         Long scheduleTime = (Long)row.getValue("scheduled");
         String scheduleTimeString = "";
         if (scheduleTime != null)
-          scheduleTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(scheduleTime.longValue());
+          scheduleTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(clientTimezone,
pageContext.getRequest().getLocale(), scheduleTime.longValue());
         String scheduledActionString = (String)row.getValue("action");
         if (scheduledActionString == null)
           scheduledActionString = "";
@@ -481,7 +492,7 @@ try
         Long retryLimit = (Long)row.getValue("retrylimit");
         String retryLimitString = "";
         if (retryLimit != null)
-          retryLimitString = org.apache.manifoldcf.ui.util.Formatter.formatTime(retryLimit.longValue());
+          retryLimitString = org.apache.manifoldcf.ui.util.Formatter.formatTime(clientTimezone,
pageContext.getRequest().getLocale(), retryLimit.longValue());
 
 %>
             <tr>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp?rev=1838010&r1=1838009&r2=1838010&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp Tue Aug 14
12:03:04 2018
@@ -762,8 +762,8 @@ try
         else
           idBucketString = idBucketObject.toString();
 
-        String startTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(Converter.asLong(row.getValue("starttime")));
-        String endTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(Converter.asLong(row.getValue("endtime")));
+        String startTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(clientTimezone,
pageContext.getRequest().getLocale(), Converter.asLong(row.getValue("starttime")));
+        String endTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(clientTimezone,
pageContext.getRequest().getLocale(), Converter.asLong(row.getValue("endtime")));
         double activityCount = Converter.asDouble(row.getValue("activitycount"));
         double activityRate = activityCount * 60000.0 / intervalMilliseconds;
 

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp?rev=1838010&r1=1838009&r2=1838010&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp Tue Aug 14
12:03:04 2018
@@ -761,8 +761,8 @@ try
           idBucketString = "";
         else
           idBucketString = idBucketObject.toString();
-        String startTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(Converter.asLong(row.getValue("starttime")));
-        String endTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(Converter.asLong(row.getValue("endtime").toString()));
+        String startTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(clientTimezone,
pageContext.getRequest().getLocale(), Converter.asLong(row.getValue("starttime")));
+        String endTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(clientTimezone,
pageContext.getRequest().getLocale(), Converter.asLong(row.getValue("endtime").toString()));
         double byteCount = Converter.asDouble(row.getValue("bytecount"));
         double bandwidth = byteCount * 1000.0 / intervalMilliseconds;
 

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/simplereport.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/simplereport.jsp?rev=1838010&r1=1838009&r2=1838010&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/simplereport.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/simplereport.jsp Tue Aug 14 12:03:04
2018
@@ -693,7 +693,7 @@ try
   while (zz < iterCount)
   {
     IResultRow row = set.getRow(zz);
-    String startTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(Converter.asLong(row.getValue("starttime")));
+    String startTimeString = org.apache.manifoldcf.ui.util.Formatter.formatTime(clientTimezone,
pageContext.getRequest().getLocale(), Converter.asLong(row.getValue("starttime")));
     String resultCode = "";
     Object resultCodeObject = row.getValue("resultcode");
     if (resultCodeObject != null)

Modified: manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Formatter.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Formatter.java?rev=1838010&r1=1838009&r2=1838010&view=diff
==============================================================================
--- manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Formatter.java
(original)
+++ manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Formatter.java
Tue Aug 14 12:03:04 2018
@@ -28,11 +28,11 @@ public class Formatter
 
   /** Format a long as an understandable date.
   *@param time is the long.
-  *@return the date, as a human-readable string.  This date will be in local time.
+  *@return the date, as a human-readable string.
   */
-  public static String formatTime(long time)
+  public static String formatTime(TimeZone tz, Locale locale, long time)
   {
-    Calendar c = new GregorianCalendar(TimeZone.getDefault(),/*TimeZone.getTimeZone("UTC"),*/
Locale.ROOT);
+    Calendar c = new GregorianCalendar(tz, locale);
     c.setTimeInMillis(time);
     // We want to format this string in a compact way:
     // mm-dd-yyyy hh:mm:ss.mmm



Mime
View raw message