fw42 / cubecomp

WCA Rubik's Cube competition website hosting
https://cubecomp.de/
MIT License
10 stars 4 forks source link

Wrong weekday for birthdays #230

Closed LinusFresz closed 8 years ago

LinusFresz commented 8 years ago

View competitor "Linus Fresz" in admin/user-mode at the competitors list for German Nationals 2016 for this issue. His birthday is at the Sunday of the competition (09.10), cubecomp says "Birthday on Monday". I guess this happens from that the competition starts on Friday, but somehow cubecomp starts counting the date from Saturday, so the date gets shifted to one day later.

LinusFresz commented 8 years ago

I also experienced another error of the same kind: For Austrian Open 2016 one person has birthday on Saturday, but her birthday is displayed with "Birthday on Wednesday".

fw42 commented 8 years ago

Thanks. Will take a look as soon as I'm back from vacation.

Laura-O commented 8 years ago

In case it is not obvious what is happening here: the weekday shown is the weekday of the actual birthday of the competitor (competitor.birthday.strftime("%A"), not the weekday of his birthday in the year of the competition.

However, my knowledge about Rails is too bad to fix that.... :-)

fw42 commented 8 years ago

Ah, thanks for looking into that, Laura. You should give it a try and see if you can figure out a fix! Would be a good learning opportunity. Feel free to message me if you need help.

fw42 commented 8 years ago

This should now be fixed, thanks to Laura.

screen shot 2016-05-26 at 08 40 37