Fixed filtering by date interval.
The lamba used to filter out arrivals/Departures was all wrong.
This commit is contained in:
parent
f311d75c73
commit
049cdaaf73
@ -609,12 +609,45 @@ namespace BreCalClient
|
||||
|
||||
if(sfm.EtaFrom != null)
|
||||
{
|
||||
_ = this._visibleControlModels.RemoveAll(x => x.Shipcall?.Eta < sfm.EtaFrom);
|
||||
_ = this._visibleControlModels.RemoveAll(x =>
|
||||
{
|
||||
Times? t = x.GetTimesForParticipantType(ParticipantType.AGENCY);
|
||||
switch (x.Shipcall?.Type)
|
||||
{
|
||||
case (int)Extensions.TypeEnum.Incoming:
|
||||
{
|
||||
if ((t != null) && t.EtaBerth.HasValue) return t.EtaBerth.Value < sfm.EtaFrom;
|
||||
return x.Shipcall?.Eta < sfm.EtaFrom;
|
||||
}
|
||||
default: // Shifting / Departing
|
||||
{
|
||||
if ((t != null) && t.EtdBerth.HasValue) return t.EtdBerth.Value < sfm.EtaFrom;
|
||||
return x.Shipcall?.Etd < sfm.EtaFrom;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(sfm.EtaTo != null)
|
||||
{
|
||||
_ = this._visibleControlModels.RemoveAll(x => x.Shipcall?.Eta > sfm.EtaTo);
|
||||
_ = this._visibleControlModels.RemoveAll(x =>
|
||||
{
|
||||
Times? t = x.GetTimesForParticipantType(ParticipantType.AGENCY);
|
||||
DateTime refValue = sfm.EtaTo.Value.AddMinutes(1439); // 23:59
|
||||
switch (x.Shipcall?.Type)
|
||||
{
|
||||
case (int)Extensions.TypeEnum.Incoming:
|
||||
{
|
||||
if ((t != null) && t.EtaBerth.HasValue) return t.EtaBerth.Value > refValue;
|
||||
return x.Shipcall?.Eta > refValue;
|
||||
}
|
||||
default: // Shifting / Departing
|
||||
{
|
||||
if ((t != null) && t.EtdBerth.HasValue) return t.EtdBerth.Value > refValue;
|
||||
return x.Shipcall?.Etd > refValue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(!_showCanceled ?? true) // canceled calls are filtered by default
|
||||
|
||||
Loading…
Reference in New Issue
Block a user