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