Browse Source

add time to log entries.

main
Gisle Aune 4 years ago
parent
commit
5e112c2a73
  1. 9
      svelte-ui/src/components/ChildEntry.svelte

9
svelte-ui/src/components/ChildEntry.svelte

@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import type { IconName, iconNames } from "../external/icons"; import type { IconName, iconNames } from "../external/icons";
import { formatTime } from "../utils/time";
import DaysLeft from "./DaysLeft.svelte"; import DaysLeft from "./DaysLeft.svelte";
import Icon from "./Icon.svelte"; import Icon from "./Icon.svelte";
import LinkHook from "./LinkHook.svelte"; import LinkHook from "./LinkHook.svelte";
@ -14,6 +15,7 @@
startTime?: string startTime?: string
endTime?: string endTime?: string
createdTime?: string createdTime?: string
loggedTime?: string
active?: boolean active?: boolean
completedAmount?: number completedAmount?: number
@ -30,9 +32,11 @@
let iconName: IconName; let iconName: IconName;
let displayName: string; let displayName: string;
let displayTime: string;
$: iconName = entry.task?.icon || entry.icon; $: iconName = entry.task?.icon || entry.icon;
$: displayName = entry.name || entry.task?.name || ""; $: displayName = entry.name || entry.task?.name || "";
$: displayTime = entry.loggedTime ? formatTime(entry.loggedTime) : "";
</script> </script>
<div class="child-entry"> <div class="child-entry">
@ -50,6 +54,11 @@
<DaysLeft startTime={entry.startTime || entry.createdTime} endTime={entry.endTime} /> <DaysLeft startTime={entry.startTime || entry.createdTime} endTime={entry.endTime} />
</div> </div>
{/if} {/if}
{#if (displayTime != null)}
<div class="times">
{displayTime}
</div>
{/if}
</div> </div>
<div class="entry-body"> <div class="entry-body">
<Markdown source={entry.description} /> <Markdown source={entry.description} />

Loading…
Cancel
Save