MapoDataFiller:

- Fix x controllo dati CSV consistenti (NON vuori)
This commit is contained in:
Samuele Locatelli
2023-06-29 10:51:45 +02:00
parent d1f7d4ff3d
commit 257cda69a5
+8 -5
View File
@@ -32,11 +32,14 @@ namespace MapoDataFiller
{
var dBlock = rawData.Split(";");
var datePart = dBlock[0].Split(' ');
string dateForm = $"{datePart[1]} {dBlock[1].Replace(".", ":")}";
dtStart = DateTime.Parse(dateForm, cultInfo);
// ora fine...
double.TryParse(dBlock[2], out numOre);
dtEnd = dtStart.AddHours(numOre);
if (datePart.Length > 1)
{
string dateForm = $"{datePart[1]} {dBlock[1].Replace(".", ":")}";
dtStart = DateTime.Parse(dateForm, cultInfo);
// ora fine...
double.TryParse(dBlock[2], out numOre);
dtEnd = dtStart.AddHours(numOre);
}
}
}
}