Mae's website :3 maemoon.me
personal website svelte sveltekit
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

DATES

+6 -5
+3 -4
src/routes/+page.svelte
··· 2 2 import { onMount } from 'svelte'; 3 3 import { fade } from 'svelte/transition'; 4 4 export let data; 5 - console.log(data); 6 - let lastUpdated = new Date(data.posts[0].meta.date); 7 - let lastUpdatedString = `${lastUpdated.getDay()}/${lastUpdated.getMonth()}/${lastUpdated.getFullYear()}`; 5 + const date = new Date(data.posts[0].meta.date); 6 + let dateString = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`; 8 7 let messages = [ 9 8 'This is a blog. Sometimes I write stuff.', 10 9 'This is a blog. I write stuff here.', ··· 14 13 'This is a blog. Thank you for reading!', 15 14 'This is a blog... or is it?', 16 15 'This is a blog. It is written in Svelte and SvelteKit.', 17 - `This is a blog. It was last updated on ${lastUpdatedString}.`, 16 + `This is a blog. It was last updated on ${dateString}.`, 18 17 'This is, unsurprisingly, a blog.' 19 18 ]; 20 19
+3 -1
src/routes/post/[slug]/+page.svelte
··· 1 1 <script> 2 2 export let data; 3 + const date = new Date(data.date); 4 + let dateString = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`; 3 5 </script> 4 6 5 7 <svelte:head> ··· 9 11 <main> 10 12 <article> 11 13 <h1>{data.title}</h1> 12 - <h2>{data.date}</h2> 14 + <h2>{dateString}</h2> 13 15 <br /> 14 16 <svelte:component this={data.content} /> 15 17 </article>