Fix installation date

This commit is contained in:
Lucio Maranta
2020-01-22 15:08:44 +01:00
parent 0c390a1ae5
commit 95e87f2ceb
6 changed files with 27 additions and 9 deletions
+2 -6
View File
@@ -351,11 +351,7 @@ namespace Step.Config
XDocument xmlConfigFile = GetXmlHandlerWithValidator(MAINTENANCES_CONFIG_SCHEMA_PATH, MAINTENANCES_CONFIG_PATH);
ReadAssistanceConfig();
var ci = new CultureInfo("en-US");
var formats = new[] { "M-d-yyyy HH:mm", "dd-MM-yyyy HH:mm", "MM-dd-yyyy HH:mm", "M/d/yyyy HH:mm", "dd/MM/yyyy HH:mm", "MM/dd/yyyy HH:mm" }
.ToArray();
MaintenancesConfig = xmlConfigFile
.Descendants("maintenances")
.Elements("maintenance")
@@ -367,7 +363,7 @@ namespace Step.Config
y => y.Attribute("langKey").Value, y => y.Value
),
Intervall = TimeSpan.FromMinutes(Convert.ToDouble(x.Element("interval").Value)),
Deadline = DateTime.ParseExact(x.Element("deadline").Value, formats, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal),
Deadline = DateTime.ParseExact(x.Element("deadline").Value, DATE_TIME_FORMATS, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal),
Type = x.Element("type").Value,
CouterId = Convert.ToInt32(x.Element("counterId").Value),
LocalizedDescription = x.Element("localizedDescription").Elements().ToDictionary( // Read localization of description