Skip to content

Commit

Permalink
fix(view): 🐛 fix incorrect time strings when longer than 1 day
Browse files Browse the repository at this point in the history
define Humanizer's `maxUnit` to `Hours`
  • Loading branch information
JamesNZL committed May 16, 2023
1 parent a99d16e commit 98f84f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TogglTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ internal async ValueTask<List<Result>> RequestViewReports(CancellationToken toke
{
new Result
{
Title = $"{total.Humanize()} tracked {spanConfiguration.Interpolation} ({total.ToString(@"h\:mm\:ss")})",
Title = $"{total.Humanize(maxUnit: Humanizer.Localisation.TimeUnit.Hour)} tracked {spanConfiguration.Interpolation} ({(int)total.TotalHours}:{total.ToString(@"mm\:ss")})",
IcoPath = "view.png",
// AutoCompleteText =
Score = (int)total.TotalSeconds,
Expand All @@ -1491,7 +1491,7 @@ internal async ValueTask<List<Result>> RequestViewReports(CancellationToken toke
return new Result
{
Title = project?.name ?? "No Project",
SubTitle = $"{((project?.client_id is not null) ? $"{me.clients?.Find(client => client.id == project.client_id)?.name} | " : string.Empty)}{elapsed.Humanize()} ({elapsed.ToString(@"h\:mm\:ss")})",
SubTitle = $"{((project?.client_id is not null) ? $"{me.clients?.Find(client => client.id == project.client_id)?.name} | " : string.Empty)}{elapsed.Humanize(maxUnit: Humanizer.Localisation.TimeUnit.Hour)} ({(int)elapsed.TotalHours}:{elapsed.ToString(@"mm\:ss")})",
IcoPath = (project?.color is not null)
? new ColourIcon(this._context, project.color, "view.png").GetColourIcon()
: "view.png",
Expand Down

0 comments on commit 98f84f9

Please sign in to comment.