We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents afffdd0 + f87f4d7 commit 2e9ca99Copy full SHA for 2e9ca99
src/routes/+page.svelte
@@ -20,7 +20,10 @@
20
21
let pathname = '';
22
23
- page.subscribe(($page) => (pathname = $page.url.searchParams.get('date')));
+ page.subscribe(($page) => {
24
+ const date = $page.url.searchParams.get('date');
25
+ pathname = date ?? new Date().toDateString();
26
+ });
27
28
// If the date query param is somehow invalid, try to set it to today
29
if (!pathname || typeof pathname !== 'string' || isNaN(new Date(pathname).valueOf())) {
tsconfig.json
@@ -2,6 +2,7 @@
2
"extends": "./.svelte-kit/tsconfig.json",
3
"compilerOptions": {
4
"allowJs": true,
5
+ "allowImportingTsExtensions": true,
6
"checkJs": true,
7
"esModuleInterop": true,
8
"forceConsistentCasingInFileNames": true,
0 commit comments