fixed two errors: 1) triggered events wouldn't work if the event was in the next hour. 2) triggered events wouldn't work if they were triggered after the last event of the week