Skip to content

Commit

Permalink
Update SS14 to master
Browse files Browse the repository at this point in the history
This mostly meant updating it to work with space-wizards/space-station-14#25280, which probably makes all times in the program consistently shown as UTC.
  • Loading branch information
PJB3005 committed Apr 16, 2024
1 parent d102138 commit 2bbfa89
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SS14.Admin/Helpers/BanHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private IQueryable<BanJoin<TBan, TUnban>> CreateBanJoin<TBan, TUnban>(DbSet<TBan
[Pure]
public static bool IsBanActive<TUnban>(IBanCommon<TUnban> b) where TUnban : IUnbanCommon
{
return (b.ExpirationTime == null || b.ExpirationTime > DateTime.Now) && b.Unban == null;
return (b.ExpirationTime == null || b.ExpirationTime > DateTime.UtcNow) && b.Unban == null;
}

[Pure]
Expand Down
2 changes: 1 addition & 1 deletion SS14.Admin/Pages/Bans/Hits.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<br>
<text><strong>Unbanned:</strong> @unbanned.UnbanTime.ToString("yyyy-MM-dd HH:mm:ss") by @Model.Ban.UnbanAdmin?.LastSeenUserName</text>
}
else if (Model.Ban.Ban.ExpirationTime < DateTime.Now)
else if (Model.Ban.Ban.ExpirationTime < DateTime.UtcNow)
{
<br>
<strong>Expired</strong>
Expand Down
4 changes: 2 additions & 2 deletions SS14.Admin/Pages/Bans/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public async Task OnGetAsync(
bans = show switch
{
ShowFilter.Active => bans.Where(b =>
b.Ban.Unban == null && (b.Ban.ExpirationTime == null || b.Ban.ExpirationTime > DateTime.Now)),
ShowFilter.Expired => bans.Where(b => b.Ban.Unban != null || b.Ban.ExpirationTime < DateTime.Now),
b.Ban.Unban == null && (b.Ban.ExpirationTime == null || b.Ban.ExpirationTime > DateTime.UtcNow)),
ShowFilter.Expired => bans.Where(b => b.Ban.Unban != null || b.Ban.ExpirationTime < DateTime.UtcNow),
_ => bans
};

Expand Down
4 changes: 2 additions & 2 deletions SS14.Admin/Pages/Logs/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public class LogsIndexModel : PageModel
public Dictionary<string, string?> AllRouteData { get; } = new();

[BindProperty(SupportsGet = true)]
public DateTime FromDate { get; set; } = DateTime.Now.Subtract(TimeSpan.FromDays(1));
public DateTime FromDate { get; set; } = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1));

[BindProperty(SupportsGet = true)]
public DateTime ToDate { get; set; } = DateTime.Now;
public DateTime ToDate { get; set; } = DateTime.UtcNow;

[BindProperty(SupportsGet = true)]
public OrderColumn Sort { get; set; } = OrderColumn.Date;
Expand Down
4 changes: 2 additions & 2 deletions SS14.Admin/Pages/RoleBans/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public async Task OnGetAsync(
bans = show switch
{
ShowFilter.Active => bans.Where(b =>
b.Ban.Unban == null && (b.Ban.ExpirationTime == null || b.Ban.ExpirationTime > DateTime.Now)),
ShowFilter.Expired => bans.Where(b => b.Ban.Unban != null || b.Ban.ExpirationTime < DateTime.Now),
b.Ban.Unban == null && (b.Ban.ExpirationTime == null || b.Ban.ExpirationTime > DateTime.UtcNow)),
ShowFilter.Expired => bans.Where(b => b.Ban.Unban != null || b.Ban.ExpirationTime < DateTime.UtcNow),
_ => bans
};

Expand Down
2 changes: 1 addition & 1 deletion SS14.Admin/Pages/Tables/BansTable.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<br>
<text><strong>Unbanned:</strong> @time.ToString("yyyy-MM-dd HH:mm:ss") by @admin</text>
}
else if (ban.Expires < DateTime.Now)
else if (ban.Expires < DateTime.UtcNow)
{
<br>
<strong>Expired</strong>
Expand Down
2 changes: 1 addition & 1 deletion SS14.Admin/Pages/Tables/RoleBansTable.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<br>
<text><strong>Unbanned:</strong> @time.ToString("yyyy-MM-dd HH:mm:ss") by @admin</text>
}
else if (ban.Expires < DateTime.Now)
else if (ban.Expires < DateTime.UtcNow)
{
<br>
<strong>Expired</strong>
Expand Down

0 comments on commit 2bbfa89

Please sign in to comment.