diff --git a/package.json b/package.json index e5be51a..fcdb5cb 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@sveltejs/vite-plugin-svelte": "^3.0.0", "@tailwindcss/typography": "^0.5.12", "@types/eslint": "^8.56.0", + "@types/luxon": "^3.4.2", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^7.0.0", "autoprefixer": "^10.4.19", @@ -25,6 +26,7 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.36.0-next.4", + "luxon": "^3.4.4", "postcss": "^8.4.38", "prettier": "^3.1.1", "prettier-plugin-svelte": "^3.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69c0134..fb9392d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,6 +26,9 @@ importers: '@types/eslint': specifier: ^8.56.0 version: 8.56.10 + '@types/luxon': + specifier: ^3.4.2 + version: 3.4.2 '@typescript-eslint/eslint-plugin': specifier: ^7.0.0 version: 7.7.1(@typescript-eslint/parser@7.7.1(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) @@ -47,6 +50,9 @@ importers: eslint-plugin-svelte: specifier: ^2.36.0-next.4 version: 2.38.0(eslint@8.57.0)(svelte@5.0.0-next.115) + luxon: + specifier: ^3.4.4 + version: 3.4.4 postcss: specifier: ^8.4.38 version: 8.4.38 @@ -464,6 +470,9 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/luxon@3.4.2': + resolution: {integrity: sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA==} + '@types/pug@2.0.10': resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==} @@ -1058,6 +1067,10 @@ packages: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} + luxon@3.4.4: + resolution: {integrity: sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==} + engines: {node: '>=12'} + magic-string@0.30.10: resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} @@ -1910,6 +1923,8 @@ snapshots: '@types/json-schema@7.0.15': {} + '@types/luxon@3.4.2': {} + '@types/pug@2.0.10': {} '@types/resolve@1.20.2': {} @@ -2548,6 +2563,8 @@ snapshots: dependencies: yallist: 4.0.0 + luxon@3.4.4: {} + magic-string@0.30.10: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 diff --git a/src/lib/components/Counter.svelte b/src/lib/components/Counter.svelte index ba742dc..9d667d6 100644 --- a/src/lib/components/Counter.svelte +++ b/src/lib/components/Counter.svelte @@ -1,50 +1,24 @@ -
+
{#if timeDifference.years > 0}
- {timeDifference.years <= 1 ? 'jaar' : 'jaren'} + {timeDifference.years == 1 ? 'jaar' : 'jaren'}
{/if} {#if timeDifference.weeks > 0} @@ -52,7 +26,7 @@ - {timeDifference.weeks <= 1 ? 'week' : 'weken'} + {timeDifference.weeks == 1 ? 'week' : 'weken'}
{/if} {#if timeDifference.days > 0} @@ -60,24 +34,24 @@ - {timeDifference.days <= 1 ? 'dag' : 'dagen'} + {timeDifference.days == 1 ? 'dag' : 'dagen'}
- {/if} -
+ {/if} +
{timeDifference.hours <= 1 ? 'uur' : 'uren'}
-
+
{timeDifference.minutes <= 1 ? 'minuut' : 'minuten'}
-
+
- + seconde
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 28a0ac7..7654d50 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,23 +1,25 @@

Maurice & Petra

-

trouwen {date.toLocaleDateString()}

+

trouwen {date.toLocaleString(DateTime.DATE_SHORT)}

Dus nog {daysLeft} nachtjes slapen

+
- -
\ No newline at end of file