Include AM/PM in datetime fields

blazor
Pat Hartl 2023-03-03 17:40:24 -06:00
parent 15f5ba7b47
commit 5b7bd5140c
5 changed files with 38 additions and 31 deletions

View File

@ -40,7 +40,7 @@
<PropertyColumn Property="e => e.Length" Sortable Title="Size">
@ByteSize.FromBytes(context.Length)
</PropertyColumn>
<PropertyColumn Property="e => e.LastWriteTime" Format="MM/dd/yyyy hh:mm" Sortable Title="Modified" />
<PropertyColumn Property="e => e.LastWriteTime" Format="MM/dd/yyyy hh:mm tt" Sortable Title="Modified" />
</Table>
</GridCol>

View File

@ -15,7 +15,7 @@
<PropertyColumn Property="a => a.CreatedBy">
@context.CreatedBy?.UserName
</PropertyColumn>
<PropertyColumn Property="a => a.CreatedOn" Format="MM/dd/yyyy hh:mm" />
<PropertyColumn Property="a => a.CreatedOn" Format="MM/dd/yyyy hh:mm tt" />
<ActionColumn Title="">
<Space Style="display: flex; justify-content: end">
<SpaceItem>

View File

@ -31,7 +31,7 @@
break;
}
</Column>
<PropertyColumn Property="g => g.ClaimedOn" Format="MM/dd/yyyy hh:mm" Sortable />
<PropertyColumn Property="g => g.ClaimedOn" Format="MM/dd/yyyy hh:mm tt" Sortable />
<ActionColumn Title="">
<Space>
<SpaceItem>

View File

@ -57,7 +57,7 @@
<PropertyColumn Property="s => s.CreatedBy">
@context.CreatedBy?.UserName
</PropertyColumn>
<PropertyColumn Property="s => s.CreatedOn" Format="MM/dd/yyyy hh:mm" />
<PropertyColumn Property="s => s.CreatedOn" Format="MM/dd/yyyy hh:mm tt" />
<ActionColumn Title="">
<Space Style="display: flex; justify-content: end">
<SpaceItem>

View File

@ -3,33 +3,35 @@
@inject GameService GameService
@inject NavigationManager NavigationManager
<Card Title="Games">
<Body>
<Table TItem="Game" DataSource="@Games" Loading="@Loading">
<Column TData="string">
<Image Src="@GetIcon(context)" Height="32" Width="32" Preview="false"></Image>
</Column>
<PropertyColumn Property="g => g.Title" Sortable />
<PropertyColumn Property="g => g.SortTitle" Sortable />
<PropertyColumn Property="g => g.ReleasedOn" Format="MM/dd/yyyy" Sortable />
<PropertyColumn Property="g => g.CreatedOn" Format="MM/dd/yyyy hh:mm" Sortable />
<PropertyColumn Property="g => g.CreatedBy" Sortable>
@context.CreatedBy?.UserName
</PropertyColumn>
<PropertyColumn Property="g => g.UpdatedOn" Format="MM/dd/yyyy hh:mm" Sortable />
<PropertyColumn Property="g => g.UpdatedBy" Sortable>
@context.UpdatedBy?.UserName
</PropertyColumn>
<ActionColumn Title="">
<Space Style="display: flex; justify-content: end">
<SpaceItem>
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Edit" OnClick="() => Edit(context)" />
</SpaceItem>
</Space>
</ActionColumn>
</Table>
</Body>
</Card>
<PageHeader Title="Games">
<PageHeaderExtra>
<Button OnClick="() => Add()" Type="@ButtonType.Primary">Add Game</Button>
</PageHeaderExtra>
</PageHeader>
<Table TItem="Game" DataSource="@Games" Loading="@Loading">
<Column TData="string">
<Image Src="@GetIcon(context)" Height="32" Width="32" Preview="false"></Image>
</Column>
<PropertyColumn Property="g => g.Title" Sortable />
<PropertyColumn Property="g => g.SortTitle" Sortable />
<PropertyColumn Property="g => g.ReleasedOn" Format="MM/dd/yyyy" Sortable />
<PropertyColumn Property="g => g.CreatedOn" Format="MM/dd/yyyy hh:mm tt" Sortable />
<PropertyColumn Property="g => g.CreatedBy" Sortable>
@context.CreatedBy?.UserName
</PropertyColumn>
<PropertyColumn Property="g => g.UpdatedOn" Format="MM/dd/yyyy hh:mm tt" Sortable />
<PropertyColumn Property="g => g.UpdatedBy" Sortable>
@context.UpdatedBy?.UserName
</PropertyColumn>
<ActionColumn Title="">
<Space>
<SpaceItem>
<Button OnClick="() => Edit(context)">Edit</Button>
</SpaceItem>
</Space>
</ActionColumn>
</Table>
@code {
IEnumerable<Game> Games { get; set; } = new List<Game>();
@ -53,6 +55,11 @@
return $"/api/Games/{game.Id}/Icon.png";
}
private void Add()
{
NavigationManager.NavigateTo("/Games/Add");
}
private void Edit(Game game)
{
NavigationManager.NavigateTo($"/Games/{game.Id}/Edit");