diff --git a/bahnplan.web/Pages/Index.cshtml b/bahnplan.web/Pages/Index.cshtml index 2dddc88..e83554e 100644 --- a/bahnplan.web/Pages/Index.cshtml +++ b/bahnplan.web/Pages/Index.cshtml @@ -42,7 +42,7 @@ trips = db.Trips.Where(p => p.UserId == Model.AuthorizedUser.UserId).ToList(); } - foreach (var trip in trips.OrderBy(p => db.Legs.First(a => a.TripId == p.TripId).ArrTime)) { + foreach (var trip in trips.OrderBy(p => db.Legs.First(a => a.TripId == p.TripId).DepTime)) { var legs = db.Legs.Where(p => p.TripId == trip.TripId).OrderBy(p => p.DepTime).ToList(); var dates = DateTime.Parse(legs.First().DepTime).Date == DateTime.Parse(legs.Last().DepTime).Date ? legs.First().DepTime.Substring(0, 10) : legs.First().DepTime.Substring(0, 10) + "
" + legs.Last().DepTime.Substring(0, 10); diff --git a/bahnplan.web/Pages/Trip.cshtml b/bahnplan.web/Pages/Trip.cshtml index 1246a4a..046f27a 100644 --- a/bahnplan.web/Pages/Trip.cshtml +++ b/bahnplan.web/Pages/Trip.cshtml @@ -114,7 +114,7 @@ @{ await using var db = new Database.DbConn(); - if (!db.Legs.Any(p => p.DepTime == leg.DepTime + "_placeholder")) { + if (!db.Legs.Any(p => p.DepTime == leg.DepTime + "_placeholder") && Model.Legs.IndexOf(leg) != Model.Legs.Count - 1) { + Separator } else {