mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-24 12:29:37 +00:00
Time spend presenter more digits (#3813)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
3b6946abc7
commit
3f7dc53656
@ -29,13 +29,13 @@
|
||||
on:click
|
||||
use:tooltip={{
|
||||
component: Label,
|
||||
props: { label: tracker.string.TimeSpendHours, params: { value: floorFractionDigits(value, 1) } }
|
||||
props: { label: tracker.string.TimeSpendHours, params: { value: floorFractionDigits(value, 2) } }
|
||||
}}
|
||||
>
|
||||
{#if noSymbol}
|
||||
{floorFractionDigits(value, 1)}
|
||||
{floorFractionDigits(value, 2)}
|
||||
{:else if value > 0 && value < 8}
|
||||
<Label label={tracker.string.TimeSpendHours} params={{ value: floorFractionDigits(value, 1) }} />
|
||||
<Label label={tracker.string.TimeSpendHours} params={{ value: floorFractionDigits(value, 2) }} />
|
||||
{:else}
|
||||
<Label label={tracker.string.TimeSpendValue} params={{ value: floorFractionDigits(value / 8, 3) }} />
|
||||
{/if}
|
||||
|
@ -133,7 +133,7 @@ function floorFractionDigits (n: number | string, amount: number): number {
|
||||
|
||||
function toTime (value: number): string {
|
||||
if (value > 0 && value < 8) {
|
||||
return `${floorFractionDigits(value, 1)}h`
|
||||
return `${floorFractionDigits(value, 2)}h`
|
||||
} else {
|
||||
return `${floorFractionDigits(value / 8, 3)}d`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user