commit ecdce6311c159c837014a7b1ea9b12ceb3ad4943
Author: A-Konig <alex-nebulae@seznam.cz>
Date:   Thu Apr 15 14:13:51 2021 +0200

    re #8610 Fixing mistakes in start times

diff --git a/Server/ServerApp/Parser/Parsers/DataParser.cs b/Server/ServerApp/Parser/Parsers/DataParser.cs
index 1c16c24..8debee3 100644
--- a/Server/ServerApp/Parser/Parsers/DataParser.cs
+++ b/Server/ServerApp/Parser/Parsers/DataParser.cs
@@ -59,15 +59,15 @@ namespace ServerApp.Parser.Parsers
             string pathLogIn = path + "login";
 
             weatherList = weatherParser.ParseWeatherData(pathWeather, wholeDay, interval);
-            jisList = jisParser.ParseJisData(pathJis, wholeDay, interval);
+            jisList = jisParser.ParseJisData(pathJis, false, 2); // wholeDay, interval);
             loginList = loginParser.ParseLogInData(pathLogIn, false, 2); // wholeDay, interval);
 
             //Console.WriteLine("WEATHER");
             //WriteToConsole(weatherList);
-            //Console.WriteLine("JIS");
-            //WriteToConsole(jisList);
-            Console.WriteLine("LOGIN");
-            WriteToConsole(loginList);
+            Console.WriteLine("JIS");
+            WriteToConsole(jisList);
+            //Console.WriteLine("LOGIN");
+            //WriteToConsole(loginList);
         }
 
         /// <summary>
diff --git a/Server/ServerApp/Parser/Parsers/JisParser.cs b/Server/ServerApp/Parser/Parsers/JisParser.cs
index 934bb9e..4881f9c 100644
--- a/Server/ServerApp/Parser/Parsers/JisParser.cs
+++ b/Server/ServerApp/Parser/Parsers/JisParser.cs
@@ -138,16 +138,13 @@ namespace ServerApp.Parser.Parsers
                 return null;
 
             int indices = (int) Math.Ceiling(range / (double)interval);
-            int[] from = new int[indices];
-            for (int i = 0; i < from.Length; i++) {
-                from[i] = minmaxHour[0] + interval * (i+1);
-                Console.Write(from[i] + " ");
-            }
-            Console.WriteLine();
+            int[] to = new int[indices];
+            for (int i = 0; i < to.Length; i++) 
+                to[i] = minmaxHour[0] + interval * (i+1);
 
             // first day
             DateTime lastStartTime = new DateTime(list[0].dateTime.Year, list[0].dateTime.Month, list[0].dateTime.Day, minmaxHour[0], 0, 0);
-            int endtime = from[0];
+            int endtime = to[0];
             int startTime = minmaxHour[0];
             int index = 0;
             for (int i = 0; i < list.Count; i++)
@@ -164,28 +161,27 @@ namespace ServerApp.Parser.Parsers
                 // end of the day
                 if (!(date.Year == lastStartTime.Year && date.Month == lastStartTime.Month && date.Day == lastStartTime.Day))
                 {
-                    endtime = from[0];
-                    startTime = minmaxHour[0];
                     trigger = true;
                     index = 0;
                 }
 
                 // end of interval period
-                if ( date.Hour >= endtime || trigger) // date.Hour > endTime (date.Hour - lastStartTime.Hour) >= interval 
+                if ( date.Hour >= endtime || trigger) 
                 {
                     // start time of last interval
                     DateTime stTime = new DateTime(lastStartTime.Year, lastStartTime.Month, lastStartTime.Day, startTime, 0, 0);
-                    
-                    // end of interval, not end of day -> need to find appropriate start and end times
+
+                    // find end and start time
                     if (!trigger)
-                    {
-                        index += 1;
-                        while (from[index] < date.Hour)
-                            index++;
+                        index++;
+                    while (date.Hour >= to[index])
+                        index++;
 
-                        endtime = from[index];
-                        startTime = from[index - 1];
-                    }
+                    endtime = to[index];
+                    if (index == 0)
+                        startTime = minmaxHour[0];
+                    else
+                        startTime = to[index - 1];
 
                     // data for each faculty separate
                     for (int k = 0; k < TagInfo.faculties.Length; k++)
diff --git a/Server/ServerApp/Parser/Parsers/LogInParser.cs b/Server/ServerApp/Parser/Parsers/LogInParser.cs
index 7f55b0c..fd14b87 100644
--- a/Server/ServerApp/Parser/Parsers/LogInParser.cs
+++ b/Server/ServerApp/Parser/Parsers/LogInParser.cs
@@ -152,10 +152,6 @@ namespace ServerApp.Parser.Parsers
                 data[i] = new int[TagInfo.faculties.Length];
             }
             
-            // 0.15h sem todle už dělal
-            // +1h
-            // udělat gitignore
-
             // first day
             DateTime lastStartTime = new DateTime(list[0].date.Year, list[0].date.Month, list[0].date.Day, minmaxHour[0], 0, 0);
             int index = 0;
diff --git a/Server/ServerApp/ServerApp.csproj b/Server/ServerApp/ServerApp.csproj
index 6b5563a..41ae389 100644
--- a/Server/ServerApp/ServerApp.csproj
+++ b/Server/ServerApp/ServerApp.csproj
@@ -73,6 +73,9 @@
     <None Include="data\jis\OD_ZCU_JIS_11_2019.CSV">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Include="data\jis\OD_ZCU_JIS_13_2019.CSV">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Include="data\jis\OD_ZCU_JIS_12_2019.CSV">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
@@ -88,7 +91,7 @@
     <None Include="data\login\OD_ZCU_STROJE_11_2019.CSV">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
-    <None Include="data\login\OD_ZCU_STROJE_12_2019 - Copy.CSV">
+    <None Include="data\login\OD_ZCU_STROJE_12_2019.CSV">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     <None Include="data\login\OD_ZCU_STROJE_13_2019.CSV">
diff --git a/Server/ServerApp/data/jis/OD_ZCU_JIS_13_2019.CSV b/Server/ServerApp/data/jis/OD_ZCU_JIS_13_2019.CSV
new file mode 100644
index 0000000..c622622
--- /dev/null
+++ b/Server/ServerApp/data/jis/OD_ZCU_JIS_13_2019.CSV
@@ -0,0 +1,20 @@
+"M14";"01.12.2019 07:03:03";1
+"L1L2-vchod";"01.12.2019 07:22:38";1
+"L2";"01.12.2019 08:22:53";1
+"A1";"01.12.2019 09:31:19";1
+"M14";"01.12.2019 10:35:40";1
+"A3";"02.12.2019 07:47:04";1
+"L2";"02.12.2019 10:48:11";1
+"A1";"02.12.2019 11:53:10";1
+"M16";"02.12.2019 12:19:27";1
+"L1L2-vchod";"02.12.2019 12:30:06";1
+"L2";"03.12.2019 07:30:23";1
+"M16";"03.12.2019 07:44:09";1
+"A3";"03.12.2019 15:45:05";1
+"L1";"03.12.2019 16:26:58";1
+"A1";"03.12.2019 17:27:46";1
+"M16";"05.12.2019 17:48:26";1
+"L1L2-vchod";"05.12.2019 18:15:33";1
+"L2";"05.12.2019 18:15:48";1
+"M14";"05.12.2019 19:19:45";1
+"L2";"05.12.2019 19:25:16";1
\ No newline at end of file
