The code and data behind xeiaso.net
0
fork

Configure Feed

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

at main 34 lines 1.3 kB view raw
1const timestampPBtoDate = ({ seconds }) => { 2 return new Date(seconds * 1000); 3}; 4 5const formatDate = (date) => { 6 return date.toLocaleDateString('en-US', { 7 month: 'long', 8 day: 'numeric', 9 year: 'numeric', 10 }); 11}; 12 13// takes within.website.x.mi.Event 14export default ({ name, url, start_date, end_date, location, description }) => { 15 const startDate = formatDate(timestampPBtoDate(start_date)); 16 const endDate = formatDate(timestampPBtoDate(end_date)); 17 return ( 18 <div className="rounded-lg p-4 bg-bg-1 dark:bg-bgDark-1"> 19 <h2 className="text-lg mb-2 text-fg-1 dark:text-fgDark-1"> 20 <a href={url} target="_blank" rel="noopener noreferrer" className="text-blue-dark dark:text-blueDark-light"> 21 {name} <span role="img" aria-label="link">🔗</span> 22 </a> 23 </h2> 24 <div className="card-content text-fg-1 dark:text-fgDark-1"> 25 <p> 26 {location} - {startDate} {start_date.seconds !== end_date.seconds ? `thru ${endDate}` : ""} 27 </p> 28 <p className="prose dark:prose-invert"> 29 {description} 30 </p> 31 </div> 32 </div> 33 ); 34};