Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Past and incoming CTFs aren't displayed if a CTF with a very old date (before 1st january 1970) is created. #228

Open
eeyoretheman opened this issue Aug 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@eeyoretheman
Copy link

If a CTF has a startTime or endTime before 1st January 1970 (before the UNIX epoch) all other Past and Incoming CTFs disappear because the frontend throws an error while parsing the date. Here's a bad temporary fix if anyone wants to fix this now.

in CTFNote/front/src/ctfnote/ctfs.ts, lines 108 and 109

startTime: extractDate(ctf.startTime),
endTime: extractDate(ctf.endTime),

should be

startTime: new Date(ctf.startTime) <= new Date("1970-01-01 00:00") ? new Date(ctf.startTime) : extractDate(ctf.startTime),
endTime: new Date(ctf.endTime) <= new Date("1970-01-01 00:00") ? new Date(ctf.endTime) : extractDate(ctf.endTime),

after that you can rebuild your docker containers with docker-compose up --build -d (remember to use sudo)

I believe the problems stems from the extractDate function in ctfs.ts + the fact that quasar only works with UNIX mils.

Thank you in advance.

@XeR XeR added the bug Something isn't working label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants