Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschonti committed Mar 17, 2024
1 parent 9435d49 commit 4b5b77c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ JWT_SCOPE="<required scope for the service account>"
GROUP_KEY="<email address of the google group>"
BACKEND_URL="https://..."
NEXT_PUBLIC_PLAUSIBLE_URL="<plausible url>"
NEXT_PUBLIC_RECAPTCHA_SITE_KEY="<>"
RECAPTCHA_SECRET="<>"
2 changes: 1 addition & 1 deletion src/components/presentation/PresentationGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function PresentationTile({
<Tile clickable={!presentation.placeholder && !preview} className='w-full h-full' disableMinHeight={true}>
<Tile.Body lessPadding='5' className='flex flex-col'>
<span className='pb-2 text-xs'>
{presentation.room !== 'BOTH' && `${presentation.room} | `}
{presentation.room !== 'BOTH' && !preview && `${presentation.room} | `}
{dateToHourAndMinuteString(presentation.startDate)} - {dateToHourAndMinuteString(presentation.endDate)}
</span>
<div className='flex flex-col justify-center flex-1'>
Expand Down
7 changes: 4 additions & 3 deletions src/components/tiles/question-tile.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client';
import { PresentationWithDates } from '@/models/models';
import { getCurrentDate } from '@/utils/dateHelper';

import { PresentationTile } from '../presentation/PresentationGrid';

Expand All @@ -10,8 +9,10 @@ type Props = {
};

export function RoomQuestion({ presentations, room }: Props) {
const now = getCurrentDate();
const presentation = presentations.find((p) => p.room === room && p.startDate < now && p.endDate > now);
const now = new Date();
const presentation = presentations.find(
(p) => p.room === room && !p.placeholder && p.startDate < now && p.endDate > now
);
return presentation ? (
<PresentationTile presentation={presentation} preview />
) : (
Expand Down
5 changes: 0 additions & 5 deletions src/utils/dateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,3 @@ export function dateToHourAndMinuteString(date: Date): string {
timeZone: 'Europe/Budapest',
});
}

export function getCurrentDate() {
return new Date(2024, 2, 19, 14, 12);
// return new Date();
}

0 comments on commit 4b5b77c

Please sign in to comment.