Author: kwright
Date: Sat Aug  5 07:36:34 2017
New Revision: 1804177

URL: http://svn.apache.org/viewvc?rev=1804177&view=rev
Log:
Final fix (I hope) for CONNECTORS-1445.

Modified:
    manifoldcf/trunk/CHANGES.txt
    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/resultreport.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/simplereport.jsp

Modified: manifoldcf/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1804177&r1=1804176&r2=1804177&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Sat Aug  5 07:36:34 2017
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 2.8-dev =====================
 
+CONNECTORS-1445: Fix timezone handling in reports to use browser timezone
+and add a timezone field for the editjob schedule page as well. 
+(Kishore Kumar, Karl Wright)
+
 CONNECTORS-1447: Update postgresql driver to the most current version.
 This should allow error free operation with Postgresql versions back to
 version 8.

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=1804177&r1=1804176&r2=1804177&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp 
(original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp 
Sat Aug  5 07:36:34 2017
@@ -23,6 +23,16 @@
 %>
 
 <%
+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
@@ -118,7 +128,7 @@ try
     else
     {
       // Convert the specified times to a long.
-      Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+      Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
       c.set(Calendar.YEAR,Integer.parseInt(startYear));
       c.set(Calendar.MONTH,Integer.parseInt(startMonth));
       c.set(Calendar.DAY_OF_MONTH,Integer.parseInt(startDay) + 1);
@@ -134,7 +144,7 @@ try
     else
     {
       // Convert the specified times to a long.
-      Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+      Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
       c.set(Calendar.YEAR,Integer.parseInt(endYear));
       c.set(Calendar.MONTH,Integer.parseInt(endMonth));
       c.set(Calendar.DAY_OF_MONTH,Integer.parseInt(endDay) + 1);
@@ -156,7 +166,7 @@ try
   else
   {
     // Do the conversion
-    Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+    Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
     c.setTimeInMillis(startTime.longValue());
     startYear = Integer.toString(c.get(Calendar.YEAR));
     startMonth = Integer.toString(c.get(Calendar.MONTH));
@@ -177,7 +187,7 @@ try
   else
   {
     // Do the conversion
-    Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+    Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
     c.setTimeInMillis(endTime.longValue());
     endYear = Integer.toString(c.get(Calendar.YEAR));
     endMonth = Integer.toString(c.get(Calendar.MONTH));

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=1804177&r1=1804176&r2=1804177&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp 
(original)
+++ 
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp 
Sat Aug  5 07:36:34 2017
@@ -23,6 +23,16 @@
 %>
 
 <%
+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
@@ -118,7 +128,7 @@ try
     else
     {
       // Convert the specified times to a long.
-      Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+      Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
       c.set(Calendar.YEAR,Integer.parseInt(startYear));
       c.set(Calendar.MONTH,Integer.parseInt(startMonth));
       c.set(Calendar.DAY_OF_MONTH,Integer.parseInt(startDay) + 1);
@@ -134,7 +144,7 @@ try
     else
     {
       // Convert the specified times to a long.
-      Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+      Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
       c.set(Calendar.YEAR,Integer.parseInt(endYear));
       c.set(Calendar.MONTH,Integer.parseInt(endMonth));
       c.set(Calendar.DAY_OF_MONTH,Integer.parseInt(endDay) + 1);
@@ -156,7 +166,7 @@ try
   else
   {
     // Do the conversion
-    Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+    Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
     c.setTimeInMillis(startTime.longValue());
     startYear = Integer.toString(c.get(Calendar.YEAR));
     startMonth = Integer.toString(c.get(Calendar.MONTH));
@@ -177,7 +187,7 @@ try
   else
   {
     // Do the conversion
-    Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+    Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
     c.setTimeInMillis(endTime.longValue());
     endYear = Integer.toString(c.get(Calendar.YEAR));
     endMonth = Integer.toString(c.get(Calendar.MONTH));

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/resultreport.jsp
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/resultreport.jsp?rev=1804177&r1=1804176&r2=1804177&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/resultreport.jsp 
(original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/resultreport.jsp Sat 
Aug  5 07:36:34 2017
@@ -23,6 +23,16 @@
 %>
 
 <%
+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
@@ -118,7 +128,7 @@ try
     else
     {
       // Convert the specified times to a long.
-      Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+      Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
       c.set(Calendar.YEAR,Integer.parseInt(startYear));
       c.set(Calendar.MONTH,Integer.parseInt(startMonth));
       c.set(Calendar.DAY_OF_MONTH,Integer.parseInt(startDay) + 1);
@@ -134,7 +144,7 @@ try
     else
     {
       // Convert the specified times to a long.
-      Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+      Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
       c.set(Calendar.YEAR,Integer.parseInt(endYear));
       c.set(Calendar.MONTH,Integer.parseInt(endMonth));
       c.set(Calendar.DAY_OF_MONTH,Integer.parseInt(endDay) + 1);
@@ -156,7 +166,7 @@ try
   else
   {
     // Do the conversion
-    Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+    Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
     c.setTimeInMillis(startTime.longValue());
     startYear = Integer.toString(c.get(Calendar.YEAR));
     startMonth = Integer.toString(c.get(Calendar.MONTH));
@@ -176,7 +186,7 @@ try
   else
   {
     // Do the conversion
-    Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+    Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
     c.setTimeInMillis(endTime.longValue());
     endYear = Integer.toString(c.get(Calendar.YEAR));
     endMonth = Integer.toString(c.get(Calendar.MONTH));

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=1804177&r1=1804176&r2=1804177&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/simplereport.jsp 
(original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/simplereport.jsp Sat 
Aug  5 07:36:34 2017
@@ -23,6 +23,16 @@
 %>
 
 <%
+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
@@ -118,7 +128,7 @@ try
     else
     {
       // Convert the specified times to a long.
-      Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+      Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
       c.set(Calendar.YEAR,Integer.parseInt(startYear));
       c.set(Calendar.MONTH,Integer.parseInt(startMonth));
       c.set(Calendar.DAY_OF_MONTH,Integer.parseInt(startDay) + 1);
@@ -134,7 +144,7 @@ try
     else
     {
       // Convert the specified times to a long.
-      Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+      Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
       c.set(Calendar.YEAR,Integer.parseInt(endYear));
       c.set(Calendar.MONTH,Integer.parseInt(endMonth));
       c.set(Calendar.DAY_OF_MONTH,Integer.parseInt(endDay) + 1);
@@ -156,7 +166,7 @@ try
   else
   {
     // Do the conversion
-    Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+    Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
     c.setTimeInMillis(startTime.longValue());
     startYear = Integer.toString(c.get(Calendar.YEAR));
     startMonth = Integer.toString(c.get(Calendar.MONTH));
@@ -176,7 +186,7 @@ try
   else
   {
     // Do the conversion
-    Calendar c = new GregorianCalendar(TimeZone.getDefault(), 
pageContext.getRequest().getLocale());
+    Calendar c = new GregorianCalendar(clientTimezone, 
pageContext.getRequest().getLocale());
     c.setTimeInMillis(endTime.longValue());
     endYear = Integer.toString(c.get(Calendar.YEAR));
     endMonth = Integer.toString(c.get(Calendar.MONTH));


Reply via email to