Skip to content

Instantly share code, notes, and snippets.

@mbsoftlab
Created December 27, 2021 21:49
Show Gist options
  • Save mbsoftlab/e10c5e9dad5654f0f74f27bb5b6609e7 to your computer and use it in GitHub Desktop.
Save mbsoftlab/e10c5e9dad5654f0f74f27bb5b6609e7 to your computer and use it in GitHub Desktop.
Blazor TimeSpanLabel
@code {
[Parameter] public System.TimeSpan Value { get; set; }
}
<span>
@if (Value.Days > 0)
{
@Value.Days <span> @(Value.Days>1?"Tage ":"Tag ") </span>
}
@if (Value.Hours > 0)
{
@Value.Hours <span> @(Value.Hours>1?"Stunden ":"Stunde ")</span>
}
@if (Value.Minutes > 0)
{
@Value.Minutes <span>@(Value.Minutes>1?"Minuten ":"Minute ") </span>
}
@if (Value.Seconds > 0)
{
@Value.Seconds <span>@(@Value.Seconds>1?"Sekunden ":"Sekunde ") </span>
}
</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment