Excel Export eingebaut
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
@inject ISnackbar Snackbar
|
||||
@inject AuthenticationStateProvider AuthStateProvider
|
||||
@inject IJSRuntime JSRuntime
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<PageTitle>KW @_kw – Wochenübersicht – Timetracker</PageTitle>
|
||||
|
||||
@@ -34,6 +35,10 @@ else
|
||||
</MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="0">
|
||||
<MudTooltip Text="Woche als Excel exportieren">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Download"
|
||||
Style="color: var(--mud-palette-primary-text)" OnClick="ExportWeekExcel" />
|
||||
</MudTooltip>
|
||||
@if (!IsCurrentWeek)
|
||||
{
|
||||
<MudButton Variant="Variant.Text" Style="color: var(--mud-palette-primary-text)"
|
||||
@@ -491,6 +496,10 @@ else
|
||||
private async Task PrevWeek() { _monday = _monday.AddDays(-7); await LoadWeek(); }
|
||||
private async Task NextWeek() { _monday = _monday.AddDays(7); await LoadWeek(); }
|
||||
private async Task GoToCurrentWeek() { _monday = GetMonday(DateOnly.FromDateTime(DateTime.Today)); await LoadWeek(); }
|
||||
private void ExportWeekExcel()
|
||||
{
|
||||
NavigationManager.NavigateTo($"api/tracker/export/week?monday={_monday:yyyy-MM-dd}", forceLoad: true);
|
||||
}
|
||||
|
||||
private static DateOnly GetMonday(DateOnly date)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user