maybe fix countdown timezone
All checks were successful
deploy / build-and-deploy (push) Successful in 26s
All checks were successful
deploy / build-and-deploy (push) Successful in 26s
This commit is contained in:
@@ -2,11 +2,10 @@
|
||||
import { onDestroy } from 'svelte';
|
||||
|
||||
interface Props {
|
||||
start?: Date,
|
||||
end: Date,
|
||||
}
|
||||
|
||||
let { start, end }: Props = $props();
|
||||
let { end }: Props = $props();
|
||||
|
||||
const title = `Spielstart ist am ${new Date(end).toLocaleString('de-DE', {
|
||||
day: '2-digit',
|
||||
@@ -17,7 +16,8 @@
|
||||
})} Uhr`;
|
||||
|
||||
function getUntil(): [number, number, number, number] {
|
||||
let diff = (end.getTime() - (start?.getTime() || Date.now()) + end.getTimezoneOffset()) / 1000;
|
||||
const now = new Date();
|
||||
const diff = (end.getTime() - now.getTime() + now.getTimezoneOffset()) / 1000;
|
||||
|
||||
return [
|
||||
Math.floor(diff / (60 * 60 * 24)),
|
||||
|
||||
Reference in New Issue
Block a user