WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ac4f95d

Browse files
committed
🐞 fix: Small postal indication bug
1 parent 32ce919 commit ac4f95d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/routes/(authenticated)/management/[conferenceId]/participants/+page.gql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
query ConferenceParticipantsByParticipationTypeQuery($conferenceId: String!) {
22
findUniqueConference(where: { id: $conferenceId }) {
33
endConference
4+
startConference
45
}
56
findManyDelegationMembers(where: { conferenceId: { equals: $conferenceId } }) {
67
user {

src/routes/(authenticated)/management/[conferenceId]/participants/+page.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import DataTable from '$lib/components/DataTable/DataTable.svelte';
1111
import type { ParticipationType, UserRowData } from './types';
1212
import { cache } from '$houdini';
13+
import { ofAgeAtConference } from '$lib/services/ageChecker';
1314
1415
const { data }: { data: PageData } = $props();
1516
const queryData = $derived(data.ConferenceParticipantsByParticipationTypeQuery);
@@ -63,10 +64,10 @@
6364
};
6465
6566
const calculateConferenceAge = (birthday: Date) => {
66-
if (!conference?.endConference) return undefined;
67-
const age = conference.endConference.getFullYear() - birthday.getFullYear();
68-
const m = conference.endConference.getMonth() - birthday.getMonth();
69-
const d = conference.endConference.getDate() - birthday.getDate();
67+
if (!conference?.startConference) return undefined;
68+
const age = conference.startConference.getFullYear() - birthday.getFullYear();
69+
const m = conference.startConference.getMonth() - birthday.getMonth();
70+
const d = conference.startConference.getDate() - birthday.getDate();
7071
return (m < 0 || (m === 0 && d < 0) ? age - 1 : age).toString();
7172
};
7273
@@ -170,7 +171,8 @@
170171
if (
171172
row.status?.termsAndConditions === 'DONE' &&
172173
row.status?.mediaConsent === 'DONE' &&
173-
row.status?.guardianConsent === 'DONE'
174+
(row.status?.guardianConsent === 'DONE' ||
175+
ofAgeAtConference(conference?.startConference, row.birthday))
174176
) {
175177
return `<i class="fas fa-check text-success"></i>`;
176178
}

0 commit comments

Comments
 (0)