fix diable and enable seconds not working in time table
This commit is contained in:
parent
55128257cb
commit
e558f3abef
3 changed files with 12 additions and 6 deletions
|
@ -1,12 +1,16 @@
|
|||
<script module>
|
||||
<script>
|
||||
import { Modal, Content, Trigger } from "sv-popup";
|
||||
|
||||
import Time from "./components/time/DisplayCollsOfTime.svelte";
|
||||
import TimeTable from "./components/timetable/DisplayRowsOfTimetable.svelte";
|
||||
import EditTimetableDiv from "./components/timetable/EditTimetable.svelte";
|
||||
import { colseModal } from "./logic/TimeAndTableData.svelte.js";
|
||||
import { colseModal, ShowSeconds } from "./logic/TimeAndTableData.svelte.js";
|
||||
import { on } from "svelte/events";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
export let ShowSeconds = $state({ v: true });
|
||||
onMount(() => {
|
||||
ShowSeconds.v = localStorage.getItem("ShowSeconds") || "true" == "true" ? true : false;
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="flex h-full flex-col">
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
import { onMount } from "svelte";
|
||||
import Row from "./row.svelte";
|
||||
|
||||
let ShowSeconds;
|
||||
import {ShowSeconds} from "../../logic/TimeAndTableData.svelte.js";
|
||||
|
||||
let ampm;
|
||||
|
||||
onMount(() => {
|
||||
ShowSeconds = localStorage.getItem("ShowSeconds") || "true" == "true" ? true : false;
|
||||
setInterval(() => {
|
||||
ampm = new Date().getHours() >= 12 ? "PM" : "AM";
|
||||
}, 1000);
|
||||
|
@ -21,7 +21,7 @@
|
|||
<Row type={"min"} digit={0} />
|
||||
<Row type={"min"} digit={1} />
|
||||
|
||||
{#if ShowSeconds}
|
||||
{#if ShowSeconds.v}
|
||||
<h1 class="text-[75px] leading-none text-gray-500">.</h1>
|
||||
|
||||
<Row type={"sec"} digit={0} />
|
||||
|
|
|
@ -18,3 +18,5 @@ export let timetableData = $state({
|
|||
});
|
||||
|
||||
export let colseModal = $state({ v: false });
|
||||
|
||||
export let ShowSeconds = $state({ v: true });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue