Skip to content

Commit

Permalink
Merge pull request #19 from apop880/dev
Browse files Browse the repository at this point in the history
Merge changes for 0.2.3
  • Loading branch information
apop880 authored Feb 28, 2023
2 parents 51afb7a + ae82156 commit 7cc30fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion rootfs/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ password=$(bashio::services "mysql" "password")
port=$(bashio::services "mysql" "port")
username=$(bashio::services "mysql" "username")
export DATABASE_URL="mysql://${username}:${password}@${host}:${port}/photodash?schema=public"
export SUPERVISOR_URL="http://supervisor/core"
npx prisma db push
cd build/client
ln -s /share share
Expand Down
14 changes: 9 additions & 5 deletions rootfs/src/routes/(app)/[name]/clock.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
timer = setInterval(
() => {
let dateObj = new Date();
hours = dateObj.getHours();
const h = dateObj.getHours();
minutes = dateObj.getMinutes();
if ($page.data.configuration?.clockFormat === "US") {
amPm = hours < 12 ? "am" : "pm";
if (amPm === "pm" && hours > 12) hours -= 12;
else if (hours === 0) hours = 12;
amPm = h < 12 ? "am" : "pm";
if (amPm === "pm" && h > 12) hours = h - 12;
else if (h === 0) hours = 12;
else hours = h;
}
else if ($page.data.configuration?.clockFormat === "INTL") {
hours = h;
}
date = dateObj.toLocaleDateString([], { weekday: 'long', month: 'long', day: 'numeric' });
}, 1000);
Expand All @@ -33,7 +37,7 @@

<div class="clock">
{#if date}
{#if amPm}{hours}{:else}{hours?.toString().padStart(2, '0')}{/if}:{minutes}{#if amPm}<span class="am-pm">{amPm}</span>{:else}<br />{/if}<br />
{#if amPm}{hours}{:else}{hours?.toString().padStart(2, '0')}{/if}:{minutes?.toString().padStart(2, '0')}{#if amPm}<span class="am-pm">{amPm}</span>{:else}<br />{/if}<br />
<span class="date">{date}</span>
{/if}
</div>
Expand Down

0 comments on commit 7cc30fb

Please sign in to comment.