mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-04 16:26:24 +08:00
fix: 晚点车次在原发车时间后不显示
This commit is contained in:
@@ -124,13 +124,13 @@ namespace CRSim.ScreenSimulator.ViewModels
|
||||
var now = TimeService.GetDateTimeNow();
|
||||
var today = now.Date;
|
||||
|
||||
if (_settings.LoadTodayOnly && today.Add((trainNumber.DepartureTime??trainNumber.ArrivalTime)!.Value) < now)
|
||||
if (_settings.LoadTodayOnly && today.Add((trainNumber.DepartureTime??trainNumber.ArrivalTime)!.Value).Add(trainNumber.Status.Value) < now)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
DateTime? AdjustTime(TimeSpan? time) =>
|
||||
time.HasValue ? (today.Add(time.Value) > now ? today.Add(time.Value) : today.Add(time.Value).AddDays(1)) : null;
|
||||
time.HasValue ? (today.Add(time.Value).Add(trainNumber.Status.Value) > now ? today.Add(time.Value) : today.Add(time.Value).AddDays(1)) : null;
|
||||
|
||||
TrainInfo.Add(new TrainInfo
|
||||
{
|
||||
|
||||
@@ -53,12 +53,12 @@ namespace CRSim.ScreenSimulator.ViewModels
|
||||
{
|
||||
var now = TimeService.GetDateTimeNow();
|
||||
var today = now.Date;
|
||||
if (_settings.LoadTodayOnly && today.Add((trainNumber.DepartureTime ?? trainNumber.ArrivalTime)!.Value) < now)
|
||||
if (_settings.LoadTodayOnly && today.Add((trainNumber.DepartureTime ?? trainNumber.ArrivalTime)!.Value).Add(trainNumber.Status.Value) < now)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
DateTime? AdjustTime(TimeSpan? time) =>
|
||||
time.HasValue ? (today.Add(time.Value) > now ? today.Add(time.Value) : today.Add(time.Value).AddDays(1)) : null;
|
||||
time.HasValue ? (today.Add(time.Value).Add(trainNumber.Status.Value) > now ? today.Add(time.Value) : today.Add(time.Value).AddDays(1)) : null;
|
||||
|
||||
TrainInfos.Add(new TrainInfo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user