Skip to content

Commit 41008bb

Browse files
authored
Merge pull request #75 from Botinoc/dev
fix error with parsing time
2 parents 48d087a + 905146c commit 41008bb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

JuniperMigration/JuniperConverter.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,9 +1903,13 @@ private void processHoursRanges(List<string> timeRanges, CheckPoint_Time cpTime)
19031903
{
19041904
string startTime = timeRange.Substring(0, timeRange.IndexOf(";"));
19051905
string stopTime = timeRange.Substring(timeRange.IndexOf(";") + 1);
1906-
1907-
TimeSpan timeCheck0 = TimeSpan.ParseExact(startTime, "hh\\:mm\\:ss", CultureInfo.InvariantCulture);
1908-
TimeSpan timeCheck1 = TimeSpan.ParseExact(stopTime, "hh\\:mm\\:ss", CultureInfo.InvariantCulture);
1906+
1907+
TimeSpan timeCheck0;
1908+
if (startTime.Length > 6) timeCheck0 = TimeSpan.ParseExact(startTime, "hh\\:mm\\:ss", CultureInfo.InvariantCulture);
1909+
else timeCheck0 = TimeSpan.ParseExact(startTime, "hh\\:mm", CultureInfo.InvariantCulture);
1910+
TimeSpan timeCheck1;
1911+
if (stopTime.Length > 6) timeCheck1 = TimeSpan.ParseExact(stopTime, "hh\\:mm\\:ss", CultureInfo.InvariantCulture);
1912+
else timeCheck1 = TimeSpan.ParseExact(stopTime, "hh\\:mm", CultureInfo.InvariantCulture);
19091913

19101914
if (TimeSpan.Compare(timeCheck0, timeCheck1) == -1)
19111915
{

0 commit comments

Comments
 (0)