diff --git a/src/IdleScreen/time.svelte b/src/IdleScreen/time.svelte index cb055c3..dec14f9 100644 --- a/src/IdleScreen/time.svelte +++ b/src/IdleScreen/time.svelte @@ -8,9 +8,20 @@ let sec1; let sec2; + let AMorPM = "AM"; + function updateTime() { const now = new Date(); - const hours = now.getHours().toString().padStart(2, "0"); + + let hours = now.getHours().toString().padStart(2, "0"); + + if (now.getHours() > 12) { + hours = (now.getHours() - 12).toString().padStart(2, "0"); + AMorPM = "PM"; + } else { + AMorPM = "AM"; + } + const minutes = now.getMinutes().toString().padStart(2, "0"); const seconds = now.getSeconds().toString().padStart(2, "0"); @@ -29,88 +40,99 @@
-
-

0

-

1

-

2

-

3

-

4

-

5

-

6

-

7

-

8

-

9

-
-
-

0

-

1

-

2

-

3

-

4

-

5

-

6

-

7

-

8

-

9

-
-

:

-
-

0

-

1

-

2

-

3

-

4

-

5

-

6

-

7

-

8

-

9

-
-
-

0

-

1

-

2

-

3

-

4

-

5

-

6

-

7

-

8

-

9

-
-

.

-
-

0

-

1

-

2

-

3

-

4

-

5

-

6

-

7

-

8

-

9

-
-
-

0

-

1

-

2

-

3

-

4

-

5

-

6

-

7

-

8

-

9

+
+
+

0

+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+
+
+

0

+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+
+

:

+
+

0

+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+
+
+

0

+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+
+

.

+
+

0

+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+
+
+

0

+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+
+

{AMorPM}