Lib: Allow customizing finished text in Countdown
This commit is contained in:
@ -1,10 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
interface CountdownProps {
|
interface CountdownProps {
|
||||||
date: string;
|
date: string;
|
||||||
|
gotext?: string;
|
||||||
extraclass?: string;
|
extraclass?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { date, extraclass = "" }: CountdownProps = $props();
|
let { date, gotext = "Go Go Go", extraclass = "" }: CountdownProps = $props();
|
||||||
|
|
||||||
// Set the date we're counting down to
|
// Set the date we're counting down to
|
||||||
const countDownDate = new Date(date).getTime();
|
const countDownDate = new Date(date).getTime();
|
||||||
@ -35,6 +36,6 @@
|
|||||||
{#if distance > 0}
|
{#if distance > 0}
|
||||||
{days + "d " + hours + "h " + minutes + "m "}
|
{days + "d " + hours + "h " + minutes + "m "}
|
||||||
{:else}
|
{:else}
|
||||||
GO GO GO GO
|
{gotext}
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
|
Reference in New Issue
Block a user