|
|
@ -1,6 +1,7 @@ |
|
|
|
<script lang="ts"> |
|
|
|
import type { GoalResult } from "../models/goal"; |
|
|
|
import type { ModalData } from "../stores/modal"; |
|
|
|
import EveryMinute from "./EveryMinute.svelte"; |
|
|
|
import Option from "./Option.svelte"; |
|
|
|
import OptionRow from "./OptionRow.svelte"; |
|
|
|
import ParentEntry from "./ParentEntry.svelte"; |
|
|
@ -14,12 +15,16 @@ |
|
|
|
let mdGoalDelete: ModalData; |
|
|
|
let msLength: number; |
|
|
|
let msElapsed: number; |
|
|
|
let now = Date.now(); |
|
|
|
|
|
|
|
function onMinute(e: {detail: Date}) { |
|
|
|
now = e.detail.getTime(); |
|
|
|
} |
|
|
|
|
|
|
|
$: mdGoalEdit = {name:"goal.edit", goal}; |
|
|
|
$: mdGoalDelete = {name:"goal.delete", goal}; |
|
|
|
|
|
|
|
$: { |
|
|
|
const now = Date.now() |
|
|
|
const start = Date.parse(goal.startTime) |
|
|
|
const length = Date.parse(goal.endTime) - start; |
|
|
|
|
|
|
@ -35,7 +40,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<EveryMinute on:minute={onMinute} /> |
|
|
|
<ParentEntry |
|
|
|
full={showAllOptions} |
|
|
|
entry={goal} |
|
|
|