feat: add yearly summary page with navigation and formatting improvements
All checks were successful
Publish Container / publish (push) Successful in 3m17s
All checks were successful
Publish Container / publish (push) Successful in 3m17s
This commit is contained in:
parent
0991128b30
commit
0d003903cf
12 changed files with 406 additions and 70 deletions
|
|
@ -383,23 +383,13 @@ else
|
|||
return false;
|
||||
}
|
||||
|
||||
private static string FormatHours(decimal? value) => value.HasValue ? FormatDurationHours(value.Value) : "—";
|
||||
private static string FormatHours(decimal? value) => value.HasValue ? DurationFormatter.FormatHours(value.Value) : "—";
|
||||
|
||||
private static string FormatSignedHours(decimal value) => value switch
|
||||
{
|
||||
> 0 => $"+{FormatDurationHours(value)}",
|
||||
< 0 => $"-{FormatDurationHours(Math.Abs(value))}",
|
||||
_ => "00:00"
|
||||
};
|
||||
private static string FormatSignedHours(decimal value) => DurationFormatter.FormatSignedHours(value);
|
||||
|
||||
private static string FormatDurationHours(decimal value)
|
||||
{
|
||||
var totalMinutes = (int)Math.Round(value * 60m, MidpointRounding.AwayFromZero);
|
||||
var sign = totalMinutes < 0 ? "-" : string.Empty;
|
||||
totalMinutes = Math.Abs(totalMinutes);
|
||||
var hours = totalMinutes / 60;
|
||||
var minutes = totalMinutes % 60;
|
||||
return $"{sign}{hours:00}:{minutes:00}";
|
||||
return DurationFormatter.FormatHours(value);
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue