3 Commits

Author SHA1 Message Date
55aa6af239 Correctly start weeks with Sunday
All checks were successful
Build Production Image / Build Production Image (push) Successful in 1m36s
The days of the week already reflected this, but the headers did not
match.
2024-08-23 18:40:58 -07:00
922a8d24dd Set user agent when requesting iCal
All checks were successful
Build Production Image / Build Production Image (push) Successful in 1m5s
2024-05-21 19:57:31 -07:00
7192f527e9 Add Linn as director
All checks were successful
Build Production Image / Build Production Image (push) Successful in 1m15s
2024-04-27 14:22:31 -07:00
3 changed files with 12 additions and 2 deletions

View File

@ -95,6 +95,10 @@ export default function Club() {
<TableLeftHeading>Leslie Brown</TableLeftHeading>
<TableCell>Director</TableCell>
</tr>
<tr>
<TableLeftHeading>Linn Hulley</TableLeftHeading>
<TableCell>Director</TableCell>
</tr>
</tbody>
</table>
</div>

View File

@ -131,7 +131,7 @@ export const CalendarComponent: React.FC<{ calendar: Calendar }> = ({ calendar }
</header>
<div className="shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col">
<div className="grid grid-cols-7 gap-px border-b border-zinc-100 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 lg:flex-none">
{[['M', 'on'], ['T', 'ue'], ['W', 'ed'], ['T', 'hu'], ['F', 'ri'], ['S', 'at'], ['S', 'un']].map((d) => (
{[['S', 'un'], ['M', 'on'], ['T', 'ue'], ['W', 'ed'], ['T', 'hu'], ['F', 'ri'], ['S', 'at']].map((d) => (
<div key={d[0] + d[1]} className="bg-white py-2">
{d[0]}<span className="sr-only sm:not-sr-only">{d[1]}</span>
</div>

View File

@ -44,7 +44,13 @@ async function loadCalendar(): Promise<void> {
return;
}
const icalContents = await (await fetch(icalAddr)).text();
console.log("Refreshing iCal from Google Calendar")
// For some reason Google Calendar is sending different content based on who is requesting it.
const headers = new Headers();
headers.set('User-Agent', 'curl/7.54.1');
const icalContents = await (await fetch(icalAddr, { headers })).text();
const events = ical.parseICS(icalContents);
const thisMonth = dayjs().startOf('month');
const yesterday = dayjs().startOf('day').subtract(1, 'day');