Berechnung der größten Zeitstempel korrigiert

This commit is contained in:
2025-12-10 18:47:58 +01:00
parent ae30e2962a
commit 0985a12b21

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AidA.Service
{
@@ -10,8 +6,12 @@ namespace AidA.Service
{
public static DateTime? MaxTimestamp(DateTime? ts1, DateTime? ts2)
{
DateTime? maxTs = null;
if (ts1 != null)
DateTime? maxTs = ts1;
if (ts1 is null)
{
maxTs = ts2;
}
else
{
if (ts2 != null)
{
@@ -19,28 +19,15 @@ namespace AidA.Service
{
maxTs = ts2;
}
else
{
maxTs = ts1;
}
}
}
else if (ts2 != null)
{
maxTs = ts2;
}
return maxTs;
}
public static DateTime? MaxTimestamp(DateTime? ts1, DateTime? ts2, DateTime? ts3)
{
DateTime? maxTs = MaxTimestamp(ts1, ts2);
if (ts3 != null && ts3 > maxTs)
{
maxTs = ts3;
}
DateTime? maxTs = MaxTimestamp(MaxTimestamp(ts1, ts2), ts3);
return maxTs;
}
}