Created
December 27, 2021 21:49
-
-
Save mbsoftlab/e10c5e9dad5654f0f74f27bb5b6609e7 to your computer and use it in GitHub Desktop.
Blazor TimeSpanLabel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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