Skip to content

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

Description

@eeyoretheman

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions