Skip to content

Commit c3be9dc

Browse files
authored
Merge pull request #644 from dump-hr/631-fix-hardcoded-date-value
Move all hardcoded dates into one file
2 parents 065894f + 433d62e commit c3be9dc

File tree

25 files changed

+185
-93
lines changed

25 files changed

+185
-93
lines changed

apps/admin-old/src/pages/HomePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const HomePage = () => {
9292
</Modal>
9393

9494
<div className={c.page}>
95-
<h1>Statistike 2025.</h1>
95+
<h1>Statistike .</h1>
9696
<div className={c.totalUsers}>
9797
<p>Trenutno korisnika:</p>
9898
<h3>{userCount}</h3>

apps/admin/src/forms/CodeForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const CodeForm: React.FC<CodeFormProps> = ({ code, onSuccess }) => {
7373
title: 'Datum isteka',
7474
defaultValue:
7575
Helper.formatExpirationDate(code?.expirationDate) ||
76-
Helper.formatExpirationDate(new Date('2025-05-24T20:00:00.000')),
76+
Helper.formatExpirationDate(new Date('2025-05-24T20:00:00.000')), //DATUM
7777
},
7878
{
7979
id: 'achievements',

apps/api/src/auth/auth.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
AchievementNames,
3+
ISO,
34
JwtResponseDto,
45
RegistrationDto,
56
} from '@ddays-app/types';
@@ -174,7 +175,7 @@ export class AuthService {
174175
AchievementNames.FirstSteps,
175176
);
176177

177-
const EARLY_BIRD_CUTOFF = new Date('2025-05-10T22:00:00.000Z'); // 10.5.2024 00:00 CEST
178+
const EARLY_BIRD_CUTOFF = new Date(ISO.EARLY_BIRD_CUTOFF_API);
178179
const currentTime = new Date();
179180

180181
const isEarlyBird = currentTime < EARLY_BIRD_CUTOFF;

apps/api/src/email/email.service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { YEAR } from '@ddays-app/types';
12
import { Injectable } from '@nestjs/common';
23
import { randomBytes } from 'crypto';
34
import { ServerClient } from 'postmark';
@@ -54,7 +55,7 @@ export class EmailService {
5455
try {
5556
await this.sendEmail(
5657
email,
57-
'DDays 2025 - Resetiranje lozinke',
58+
`DDays ${YEAR} - Resetiranje lozinke`,
5859
`Pozdrav, klikni na link ispod da resetiraš lozinku: ${resetLink}\n\nLink za resetiranje lozinke traje 15 minuta.`,
5960
);
6061
return {
@@ -125,7 +126,7 @@ export class EmailService {
125126
try {
126127
await this.sendEmail(
127128
email,
128-
'DDays 2025 - Potvrda email adrese',
129+
`DDays ${YEAR} - Potvrda email adrese`,
129130
`Pozdrav, klikni na link ispod da potvrdiš svoju email adresu: ${confirmationLink}`,
130131
);
131132
return { success: true, message: 'Email za potvrdu je poslan' };

apps/api/src/event/event.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
EventWithUsersDto,
99
NotificationStatus,
1010
UserToEventDto,
11+
YEAR,
1112
} from '@ddays-app/types';
1213
import {
1314
HttpException,
@@ -537,7 +538,7 @@ export class EventService {
537538
async generateIcal(userId: number): Promise<string> {
538539
try {
539540
const mySchedule = await this.getEventsInMySchedule(userId);
540-
const calendar = ical({ name: 'DUMP Days 2025.' });
541+
const calendar = ical({ name: `DUMP Days ${YEAR}.` });
541542

542543
mySchedule.forEach((event) => {
543544
let location = '';

apps/app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" href="/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>DUMP Days 2025 - App</title>
7+
<title>DUMP Days 2026 - App</title>
88
<script src="https://accounts.google.com/gsi/client" async defer></script>
99
</head>
1010
<body>

apps/app/src/api/auth/useUserRegister.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import axios from '../base';
22
import toast from 'react-hot-toast';
33
import { useMutation } from 'react-query';
44
import { QUERY_KEYS } from '@/constants/queryKeys';
5-
import { JwtResponseDto, RegistrationDto } from '@ddays-app/types';
5+
import { JwtResponseDto, RegistrationDto, ISO } from '@ddays-app/types';
66
import RedStarIcon from '@/components/RedStarIcon';
77

88
const registerUser = async (data: {
@@ -25,7 +25,7 @@ export const useUserRegister = (navigate: () => void) => {
2525
position: 'top-center',
2626
});
2727

28-
const EARLY_BIRD_CUTOFF = new Date('2025-05-09T22:00:00.000Z'); // 10.5.2024 00:00 CEST
28+
const EARLY_BIRD_CUTOFF = new Date(ISO.EARLY_BIRD_CUTOFF_FRONTEND); // DATUM
2929
const currentTime = new Date();
3030

3131
if (currentTime < EARLY_BIRD_CUTOFF) {

apps/app/src/components/Accreditation/Accreditation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const Accreditation: React.FC<AccreditationProps> = ({ isOpen, onClose }) => {
123123
</div>
124124
<RecieptText
125125
item={{
126-
id: 'dumpdays2025',
126+
id: 'dumpdays2026',
127127
userId: String(user?.email),
128128
orderedAt: new Date(),
129129
shopItem: {

apps/app/src/pages/FlyTalksApplyPage/FlyTalksApplyPage.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useEffect, useMemo, useState } from 'react';
2+
import { ISO, DISPLAY } from '@ddays-app/types';
23
import c from './FlyTalksApplyPage.module.scss';
34
import { useLocation } from 'react-router-dom';
45
import { Input } from '../../components/Input';
@@ -25,7 +26,10 @@ const FlyTalksApplyPage = () => {
2526
id: event.id,
2627
start: formatTime(event.startsAt),
2728
end: formatTime(event.endsAt),
28-
day: event.startsAt.split('T')[0] === '2025-05-23' ? 1 : 2,
29+
day:
30+
event.startsAt.split('T')[0] === ISO.FIRST_DAY_START.split('T')[0]
31+
? 1
32+
: 2,
2933
participantsNumber: Array.isArray(event.users) ? event.users.length : 0,
3034
hasUserApplied: Array.isArray(event.users)
3135
? event.users.some((user) => user.id === 1)
@@ -148,7 +152,9 @@ const FlyTalksApplyPage = () => {
148152
<div className={c.mainContent}>
149153
<div className={c.timeContainer}>
150154
<p className={c.dateParagraph}>
151-
{group?.day === 1 ? '23.05. // PETAK' : '24.05. // SUBOTA'}
155+
{group?.day === 1
156+
? DISPLAY.FLYTALKS_DAY_1
157+
: DISPLAY.FLYTALKS_DAY_2}
152158
</p>
153159
<p className={c.timeParagraph}>
154160
{group?.start} - {group?.end}

apps/app/src/pages/FlyTalksList/FlyTalksList.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useState } from 'react';
2+
import { DISPLAY, ISO } from '@ddays-app/types';
23
import Tab from '../../components/Tab';
34
import TabGroup from '../../components/TabGroup';
45
import c from './FlyTalksList.module.scss';
@@ -25,7 +26,10 @@ const FlyTalksList = () => {
2526
isApplicationOpen: event.isApplicationOpen,
2627
start: event.startsAt.split('T')[1]?.slice(0, 5),
2728
end: event.endsAt.split('T')[1]?.slice(0, 5),
28-
day: event.startsAt.split('T')[0] === '2025-05-23' ? 1 : 2,
29+
day:
30+
event.startsAt.split('T')[0] === ISO.FIRST_DAY_START.split('T')[0]
31+
? 1
32+
: 2,
2933
participantsNumber: Array.isArray(event.users) ? event.users.length : 0,
3034
hasUserApplied: Array.isArray(event.users)
3135
? event.users.some((user) => user.id === currentUser?.id)
@@ -50,8 +54,8 @@ const FlyTalksList = () => {
5054
<main>
5155
<div className={c.tabGroup}>
5256
<TabGroup setter={handleTabChange}>
53-
<Tab id={Tabs.first_day}>23.05.</Tab>
54-
<Tab id={Tabs.second_day}>24.05.</Tab>
57+
<Tab id={Tabs.first_day}>{DISPLAY.FIRST_DAY_DATE}</Tab>
58+
<Tab id={Tabs.second_day}>{DISPLAY.SECOND_DAY_DATE}</Tab>
5559
</TabGroup>
5660
</div>
5761
<p className={c.listInfoText}>

0 commit comments

Comments
 (0)