It seems that I didn't handle the dates correctly, but now it should be fixed, just had to do some tweaking, damn Javascript and its Date.getDay and Date.getDate, makes no sense