fix diable and enable seconds not working in time table

This commit is contained in:
RezHackXYZ 2025-06-01 12:09:37 +05:30
parent 55128257cb
commit e558f3abef
3 changed files with 12 additions and 6 deletions

View file

@ -1,12 +1,16 @@
<script module> <script>
import { Modal, Content, Trigger } from "sv-popup"; import { Modal, Content, Trigger } from "sv-popup";
import Time from "./components/time/DisplayCollsOfTime.svelte"; import Time from "./components/time/DisplayCollsOfTime.svelte";
import TimeTable from "./components/timetable/DisplayRowsOfTimetable.svelte"; import TimeTable from "./components/timetable/DisplayRowsOfTimetable.svelte";
import EditTimetableDiv from "./components/timetable/EditTimetable.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> </script>
<div class="flex h-full flex-col"> <div class="flex h-full flex-col">

View file

@ -2,11 +2,11 @@
import { onMount } from "svelte"; import { onMount } from "svelte";
import Row from "./row.svelte"; import Row from "./row.svelte";
let ShowSeconds; import {ShowSeconds} from "../../logic/TimeAndTableData.svelte.js";
let ampm; let ampm;
onMount(() => { onMount(() => {
ShowSeconds = localStorage.getItem("ShowSeconds") || "true" == "true" ? true : false;
setInterval(() => { setInterval(() => {
ampm = new Date().getHours() >= 12 ? "PM" : "AM"; ampm = new Date().getHours() >= 12 ? "PM" : "AM";
}, 1000); }, 1000);
@ -21,7 +21,7 @@
<Row type={"min"} digit={0} /> <Row type={"min"} digit={0} />
<Row type={"min"} digit={1} /> <Row type={"min"} digit={1} />
{#if ShowSeconds} {#if ShowSeconds.v}
<h1 class="text-[75px] leading-none text-gray-500">.</h1> <h1 class="text-[75px] leading-none text-gray-500">.</h1>
<Row type={"sec"} digit={0} /> <Row type={"sec"} digit={0} />

View file

@ -18,3 +18,5 @@ export let timetableData = $state({
}); });
export let colseModal = $state({ v: false }); export let colseModal = $state({ v: false });
export let ShowSeconds = $state({ v: true });